]> Cypherpunks repositories - gostls13.git/commit
context: avoid defer in the cancelCtx.Err method
authorKeegan Carruthers-Smith <keegan.csmith@gmail.com>
Sun, 15 Apr 2018 21:22:13 +0000 (22:22 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 15 Apr 2018 21:35:53 +0000 (21:35 +0000)
commit0b9c1ad20d4d4120e30f05129987f44de57032be
tree61c80bbdcaeccafb47173f66f826d176e0ceebbc
parente7b1d0a9cfad0347748dc9478641f76f60808a64
context: avoid defer in the cancelCtx.Err method

name                  old time/op  new time/op  delta
CheckCanceled/Err-4   53.5ns ± 2%  20.8ns ± 0%  -61.05%  (p=0.008 n=5+5)
CheckCanceled/Done-4  44.4ns ± 1%  44.5ns ± 0%     ~     (p=0.889 n=5+5)

Change-Id: I2c68700a2b33f8feb3d307ce7c966590a3e960af
Reviewed-on: https://go-review.googlesource.com/107137
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/context/benchmark_test.go
src/context/context.go