Files
piik/prototype
T
AAA 26c407fc64 fix(native): pace the random preparation by schedule so a coarse timer keeps its rate
The pool and the search slept until one interval after each send. A tokio
timer on Windows wakes on the 15.6 ms system tick, so 2 ms became about 15 ms:
priming 256 sockets took about three to four seconds and 512 probes about
eight, inside a preparation that has five seconds in all. Every recorded trial
of the random method ran on Linux, where the timer is fine.

The next send is now due one interval after the previous due time. A late wake
sends what is due and the mean rate holds, which is how tokio's own Interval
behaves by default. The schedule restarts when the probe loop starts, so the
search does not count its wait for Ready as time to catch up on.

The pool test now bounds priming at three times its nominal time. With the old
assignment it fails on Windows at 2.9 s; with the new one the twelve
preparation tests finish in 1.3 s.
26c407fc64 · 2026-11-26 05:29:29 +08:00
History
..