commit | 86c4b0a6ec70b07ab49d3813a5576ed295e269e9 | [log] [tgz] |
---|---|---|
author | Carlo Alberto Ferraris <cafxx@strayorange.com> | Thu Feb 02 11:07:34 2023 +0900 |
committer | Gopher Robot <gobot@golang.org> | Fri Feb 03 22:28:04 2023 +0000 |
tree | 9676397ba3eee554b2d22869cddf6f6aaa7a8620 | |
parent | c3b4c27fd31b51226274a0c038e9c10a65f11657 [diff] |
context: remove one allocation in timerCtx Embed the cancelCtx into timerCtx, instead of allocating both separately. name old time/op new time/op delta WithTimeout/concurrency=40-16 2.21µs ±11% 2.08µs ± 5% -5.76% (p=0.011 n=10+10) WithTimeout/concurrency=4000-16 1.94µs ± 6% 1.86µs ±10% ~ (p=0.099 n=9+10) WithTimeout/concurrency=400000-16 1.86µs ± 7% 1.83µs ±10% ~ (p=0.353 n=10+10) name old alloc/op new alloc/op delta WithTimeout/concurrency=40-16 2.56kB ± 0% 2.40kB ± 0% -6.25% (p=0.001 n=8+9) WithTimeout/concurrency=4000-16 2.56kB ± 0% 2.40kB ± 0% -6.25% (p=0.000 n=9+10) WithTimeout/concurrency=400000-16 2.56kB ± 0% 2.40kB ± 0% -6.26% (p=0.000 n=9+9) name old allocs/op new allocs/op delta WithTimeout/concurrency=40-16 50.0 ± 0% 40.0 ± 0% -20.00% (p=0.000 n=10+10) WithTimeout/concurrency=4000-16 50.0 ± 0% 40.0 ± 0% -20.00% (p=0.000 n=10+10) WithTimeout/concurrency=400000-16 50.0 ± 0% 40.0 ± 0% -20.00% (p=0.000 n=10+10) Change-Id: Ia0460db3b8412fbaa6f1539fd6b4fb1b873896c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/463999 Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.