]>
Cypherpunks repositories - gostls13.git/commit
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>