commit | 601eee39de1f9d215274f54d57af80ee163e11f1 | [log] [tgz] |
---|---|---|
author | sergey <sngasuan@gmail.com> | Sun Mar 10 16:13:08 2019 +0300 |
committer | Brad Fitzpatrick <bradfitz@golang.org> | Tue Apr 23 23:44:39 2019 +0000 |
tree | 4481988bd4b1e3f89bd5737c4e0a24fe0473e0ea | |
parent | 24513d33b1d6f4b5231baf7c1b896968b35841b6 [diff] |
net/url: Reduce allocation on parsing URL func Build result string via string.Builder to avoid allocation. As side effect some performance boots. name old time/op new time/op delta QueryUnescape/#00-4 114ns ± 0% 98ns ± 1% -13.89% (p=0.000 n=4+5) QueryUnescape/#01-4 401ns ± 2% 383ns ± 1% -4.54% (p=0.008 n=5+5) QueryUnescape/#02-4 300ns ± 2% 274ns ± 2% -8.66% (p=0.008 n=5+5) QueryUnescape/#03-4 564ns ± 2% 542ns ± 2% -4.04% (p=0.008 n=5+5) QueryUnescape/#04-4 3.27µs ± 2% 3.34µs ± 8% ~ (p=0.690 n=5+5) PathUnescape/#00-4 112ns ± 2% 99ns ± 3% -11.25% (p=0.008 n=5+5) PathUnescape/#01-4 392ns ± 2% 374ns ± 6% ~ (p=0.063 n=5+5) PathUnescape/#02-4 296ns ± 2% 274ns ± 2% -7.43% (p=0.008 n=5+5) PathUnescape/#03-4 556ns ± 2% 537ns ± 1% -3.45% (p=0.008 n=5+5) PathUnescape/#04-4 2.99µs ± 1% 3.00µs ± 1% ~ (p=0.690 n=5+5) name old allocs/op new allocs/op delta QueryUnescape/#00-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) QueryUnescape/#01-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) QueryUnescape/#02-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) QueryUnescape/#03-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) QueryUnescape/#04-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) PathUnescape/#00-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) PathUnescape/#01-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) PathUnescape/#02-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) PathUnescape/#03-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) PathUnescape/#04-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.008 n=5+5) Change-Id: I7cba5eb53bebef7b1fdd44598eed47241ce83167 Reviewed-on: https://go-review.googlesource.com/c/go/+/166463 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
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 3.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://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.