]> Cypherpunks.ru repositories - gostls13.git/commitdiff
testing: Document RunParallel ns/op behavior
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Wed, 2 Nov 2022 08:28:54 +0000 (09:28 +0100)
committerGopher Robot <gobot@golang.org>
Mon, 7 Nov 2022 10:44:33 +0000 (10:44 +0000)
Updates #31884

Change-Id: Ibad3d31038a8426c0bce61c1726392880f934865
Reviewed-on: https://go-review.googlesource.com/c/go/+/447136
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/testing/benchmark.go

index 31fc7d7156b409511b206a2063b65234d52bc469..be9b87f80bbdec7a29fafb2ecb2ba7f34980620b 100644 (file)
@@ -777,6 +777,9 @@ func (pb *PB) Next() bool {
 // goroutine-local state and then iterate until pb.Next returns false.
 // It should not use the StartTimer, StopTimer, or ResetTimer functions,
 // because they have global effect. It should also not call Run.
+//
+// RunParallel reports ns/op values as wall time for the benchmark as a whole,
+// not the sum of wall time or CPU time over each parallel goroutine.
 func (b *B) RunParallel(body func(*PB)) {
        if b.N == 0 {
                return // Nothing to do when probing.