You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/wgengine
Josh Bleecher Snyder ceaaa23962 wgengine/wglog: cache strings
We repeat many peers each time we call SetPeers.
Instead of constructing strings for them from scratch every time,
keep strings alive across iterations.

name        old time/op    new time/op    delta
SetPeers-8    3.58µs ± 1%    2.41µs ± 1%  -32.60%  (p=0.000 n=9+10)

name        old alloc/op   new alloc/op   delta
SetPeers-8    2.53kB ± 0%    1.30kB ± 0%  -48.73%  (p=0.000 n=10+10)

name        old allocs/op  new allocs/op  delta
SetPeers-8      99.0 ± 0%      16.0 ± 0%  -83.84%  (p=0.000 n=10+10)

We could reduce alloc/op 12% and allocs/op 23% if strs had
type map[string]strCache instead of map[string]*strCache,
but that wipes out the execution time impact.
Given that re-use is the most common scenario, let's optimize for it.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
5 years ago
..
bench all: adapt to opaque netaddr types 5 years ago
filter all: adapt to opaque netaddr types 5 years ago
magicsock all: adapt to opaque netaddr types 5 years ago
monitor all: adapt to opaque netaddr types 5 years ago
netstack all: adapt to opaque netaddr types 5 years ago
router all: adapt to opaque netaddr types 5 years ago
wgcfg all: adapt to opaque netaddr types 5 years ago
wglog wgengine/wglog: cache strings 5 years ago
winnet wgengine/winnet: don't build on non-windows 5 years ago
mem_ios.go go.mod: update wireguard-go, taking control over iOS memory usage from our fork 5 years ago
pendopen.go all: adapt to opaque netaddr types 5 years ago
userspace.go wgengine: pass an addressable value to deephash.UpdateHash 5 years ago
userspace_ext_test.go cmd/tailscaled, wgengine{,/netstack}: add netstack hybrid mode, add to Windows 5 years ago
userspace_test.go all: adapt to opaque netaddr types 5 years ago
watchdog.go wgengine: take in dns.Config, split out to resolver.Config and dns.OSConfig. 5 years ago
watchdog_test.go wgengine: extend TestWatchdog timeout on macOS 5 years ago
wgengine.go tailcfg: add Endpoint, EndpointType, MapRequest.EndpointType 5 years ago