diff options
| author | Joe Tsai <joetsai@digital-static.net> | 2021-08-02 21:29:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-02 21:29:14 -0700 |
| commit | 01d4dd331d6255bd8fe4b8e9e4197253ff59efe7 (patch) | |
| tree | 34b0e823f5cc562ec3093f6befec87497f1a015c /control/controlknobs/controlknobs.go | |
| parent | be921d1a957bc04038c7e1c36bed3b568632bce0 (diff) | |
| download | tailscale-01d4dd331d6255bd8fe4b8e9e4197253ff59efe7.tar.xz tailscale-01d4dd331d6255bd8fe4b8e9e4197253ff59efe7.zip | |
util/deephash: simplify hasher.hashMap (#2503)
The swapping of bufio.Writer between hasher and mapHasher is subtle.
Just embed a hasher in mapHasher to avoid complexity here.
No notable change in performance:
name old time/op new time/op delta
Hash-8 76.7µs ± 1% 77.0µs ± 1% ~ (p=0.182 n=9+10)
HashMapAcyclic-8 62.4µs ± 1% 62.5µs ± 1% ~ (p=0.315 n=10+9)
TailcfgNode-8 10.3µs ± 1% 10.3µs ± 1% -0.62% (p=0.004 n=10+9)
HashArray-8 1.07µs ± 1% 1.06µs ± 1% -0.98% (p=0.001 n=8+9)
Signed-off-by: Joe Tsai <joetsai@digital-static.net>
Diffstat (limited to 'control/controlknobs/controlknobs.go')
0 files changed, 0 insertions, 0 deletions
