diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2021-01-29 15:41:18 -0800 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2021-02-24 16:38:32 +0000 |
| commit | ae1fa08e4138c49c8e7fa10c3eadbfca0233842b (patch) | |
| tree | a4a3c36cd71db88b28d46ec70181540be8008460 /src/testing/testing.go | |
| parent | 691ac806d20616fab66bb50752edfa9e4e9f8151 (diff) | |
| download | go-ae1fa08e4138c49c8e7fa10c3eadbfca0233842b.tar.xz | |
context: reduce contention in cancelCtx.Done
Use an atomic.Value to hold the done channel.
Conveniently, we have a mutex handy to coordinate writes to it.
name old time/op new time/op delta
ContextCancelDone-8 67.5ns ±10% 2.2ns ±11% -96.74% (p=0.000 n=30+28)
Fixes #42564
Change-Id: I5d72e0e87fb221d4e230209e5fb4698bea4053c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/288193
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Trust: Sameer Ajmani <sameer@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/testing/testing.go')
0 files changed, 0 insertions, 0 deletions
