]> Cypherpunks repositories - gostls13.git/commit
time: clean up benchmarks
authorRuss Cox <rsc@golang.org>
Mon, 11 Mar 2024 03:41:33 +0000 (23:41 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 13 Mar 2024 20:57:28 +0000 (20:57 +0000)
commit74a0e3160d969fac27a65cd79a76214f6d1abbf5
treeec873add0a21598e78c00bd6c7c312e2a45d0d57
parent418e6d559e80e9d53e4a4c94656e8fb4bf72b343
time: clean up benchmarks

Comparing BenchmarkStop against very old commits like
CL 13094043, I was very confused about how timers had
gotten almost 10X slower since 2013.

It turns out that CL 68060043 introduced a factor of 1000
in the benchmark cost, by counting batches of 1000 as 1 op
instead of 1000 ops, and timers have actually gotten
dramatically faster since 2013, with the addition of per-P
timer heaps and other optimizations.

This CL rewrites the benchmarks to use testing.PB directly,
so that the factor of 1000 disappears, and "/op" really means "/op".
In the few tests that need to run in batches for one reason or
another, add "1000" to the name to make clear that batches
are being run.

Change-Id: I27ed74d1e420934982e4205aad4f218cdfc42509
Reviewed-on: https://go-review.googlesource.com/c/go/+/570495
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/time/sleep_test.go
src/time/tick_test.go