Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information