go /
time /
2bc1b4fbcc7c3eda9a26f6e523cac1196c6fecd7 rate: double reserveN perf by 2x
This commit increase the speed of reserveN by 2x by removing the defer
to unlock.
NOTE: I did an audit of the code between Lock and Unlock and did not see
anything that can panic causing the Unlock to averted.
benchmark old ns/op new ns/op delta
BenchmarkAllowN-4 290 143 -50.69%
benchmark old allocs new allocs delta
BenchmarkAllowN-4 0 0 +0.00%
benchmark old bytes new bytes delta
BenchmarkAllowN-4 0 0 +0.00%
Change-Id: I01c23f4998f5451ea8efedd02e744fb5a74eae0d
Reviewed-on: https://go-review.googlesource.com/29379
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2 files changed