wgengine/bench: improved rate selection.

The old decay-based one took a while to converge. This new one (based
very loosely on TCP BBR) seems to converge quickly on what seems to be
the best speed.

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
Avery Pennarun
2021-03-28 00:23:07 -04:00
parent a92b9647c5
commit a7fe1d7c46
3 changed files with 31 additions and 17 deletions

View File

@@ -81,7 +81,7 @@ func runOnce(b *testing.B, setup SetupFunc, payload int) {
traf.Start(Addr1.IP, Addr2.IP, payload, int64(b.N))
var cur, prev Snapshot
var pps float64
var pps int64
i := 0
for traf.Running() {
i += 1
@@ -93,7 +93,7 @@ func runOnce(b *testing.B, setup SetupFunc, payload int) {
d := cur.Sub(prev)
if prev.WhenNsec != 0 {
logf("%v @%7.0f pkt/sec", d, pps)
logf("%v @%7d pkt/sec", d, pps)
}
}