diff options
| author | Russ Cox <rsc@golang.org> | 2017-11-29 16:31:47 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2017-12-01 00:24:53 +0000 |
| commit | f3b24b9f0766351fc8b3d43c4ea03f948a460e75 (patch) | |
| tree | 47d98813a65eabd79410b9a278f6782ebcd83c2f /src/testing/benchmark.go | |
| parent | 301b127a058c9bf3859e2a8c49e1ffc3c3398077 (diff) | |
| download | go-f3b24b9f0766351fc8b3d43c4ea03f948a460e75.tar.xz | |
testing: remove claim that b.Run is safe for concurrent use
It's not safe (it crashes), and it's also useless: if you run
multiple benchmarks in parallel you will not get reliable
timing results from any of them.
Fixes #18603.
Change-Id: I00e5a72f7c98151543cf7d5573c38383276e391a
Reviewed-on: https://go-review.googlesource.com/80841
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/testing/benchmark.go')
| -rw-r--r-- | src/testing/benchmark.go | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go index 2d0de180d7..4d569b7971 100644 --- a/src/testing/benchmark.go +++ b/src/testing/benchmark.go @@ -475,9 +475,6 @@ func (ctx *benchContext) processBench(b *B) { // // A subbenchmark is like any other benchmark. A benchmark that calls Run at // least once will not be measured itself and will be called once with N=1. -// -// Run may be called simultaneously from multiple goroutines, but all such -// calls must return before the outer benchmark function for b returns. func (b *B) Run(name string, f func(b *B)) bool { // Since b has subbenchmarks, we will no longer run it as a benchmark itself. // Release the lock and acquire it on exit to ensure locks stay paired. |
