tailscale/util/deephash
Joe Tsai 01d4dd331d
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>
2021-08-02 21:29:14 -07:00
..
deephash_test.go util/deephash: improve cycle detection (#2470) 2021-07-22 15:22:48 -07:00
deephash.go util/deephash: simplify hasher.hashMap (#2503) 2021-08-02 21:29:14 -07:00
mapiter_future.go util/deephash: move internal/deephash to util/deephash 2021-07-02 21:33:02 -07:00
mapiter.go util/deephash: move internal/deephash to util/deephash 2021-07-02 21:33:02 -07:00