1
0
mirror of https://github.com/golang/go synced 2024-11-05 17:46:16 -07:00
The Go programming language
Go to file
Tobias Klauser f2cd6d60ae net/netip: reduce allocations in Addr.String for v4-in-v6 addresses
ip.Unmap will always return an Addr with ip.z == z4 in case of an
v4-in-v6 address. Thus, Addr.string4 can be called directly without the
additional indirection.

name                      old time/op    new time/op    delta
IPString/v6_v4-4             108ns ± 3%      74ns ± 4%  -31.23%  (p=0.000 n=9+10)
IPStringExpanded/v6_v4-4    89.6ns ± 6%    77.2ns ± 3%  -13.91%  (p=0.000 n=10+10)
AddrPortString/v6_v4-4       253ns ± 8%     197ns ± 3%  -22.13%  (p=0.000 n=10+10)

name                      old alloc/op   new alloc/op   delta
IPString/v6_v4-4             40.0B ± 0%     24.0B ± 0%  -40.00%  (p=0.000 n=10+10)
IPStringExpanded/v6_v4-4     48.0B ± 0%     48.0B ± 0%     ~     (all equal)
AddrPortString/v6_v4-4       77.0B ± 0%     61.0B ± 0%  -20.78%  (p=0.000 n=10+10)

name                      old allocs/op  new allocs/op  delta
IPString/v6_v4-4              2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
IPStringExpanded/v6_v4-4      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrPortString/v6_v4-4        4.00 ± 0%      3.00 ± 0%  -25.00%  (p=0.000 n=10+10)

Change-Id: Id4affaf7a493aa11579c48721294f2e5889a8bef
Reviewed-on: https://go-review.googlesource.com/c/go/+/403914
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2022-05-11 23:26:11 +00:00
.github .github: remove duplicate security link 2022-01-07 17:55:09 +00:00
api io: add an Err field to LimitedReader 2022-05-04 20:06:32 +00:00
doc doc: mention jump tables and tsan upgrades in 1.19 release notes 2022-05-11 05:57:07 +00:00
lib/time lib/time, time/tzdata: update to 2021e 2021-11-11 05:16:39 +00:00
misc cmd/dist: add asan tests for global objects in testsanitizers package 2022-05-05 04:05:43 +00:00
src net/netip: reduce allocations in Addr.String for v4-in-v6 addresses 2022-05-11 23:26:11 +00:00
test cmd/asm: require -p flag 2022-05-11 22:59:46 +00:00
.gitattributes
.gitignore internal/buildcfg: move build configuration out of cmd/internal/objabi 2021-04-16 19:20:53 +00:00
AUTHORS A+C: add Jinzhu Zhang 2022-05-08 17:28:26 +00:00
codereview.cfg codereview.cfg: add codereview.cfg for master branch 2021-02-19 18:44:53 +00:00
CONTRIBUTING.md
CONTRIBUTORS A+C: add Jinzhu Zhang 2022-05-08 17:28:26 +00:00
LICENSE
PATENTS
README.md README.md: update wiki link 2022-04-26 16:21:18 +00:00
SECURITY.md SECURITY.md: replace golang.org with go.dev 2022-04-26 19:59:47 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image 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.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

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.

Contributing

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.