tailscale/util/deephash
Joe Tsai d8fbce7eef
util/deephash: hash uint{8,16,32,64} explicitly (#2502)
Instead of hashing the humanly formatted forms of a number,
hash the native machine bits of the integers themselves.

There is a small performance gain for this:
	name              old time/op    new time/op    delta
	Hash-8              75.7µs ± 1%    76.0µs ± 2%    ~            (p=0.315 n=10+9)
	HashMapAcyclic-8    63.1µs ± 3%    61.3µs ± 1%  -2.77%        (p=0.000 n=10+10)
	TailcfgNode-8       10.3µs ± 1%    10.2µs ± 1%  -1.48%        (p=0.000 n=10+10)
	HashArray-8         1.07µs ± 1%    1.05µs ± 1%  -1.79%        (p=0.000 n=10+10)

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2021-08-02 21:44:13 -07:00
..
deephash_test.go util/deephash: hash uint{8,16,32,64} explicitly (#2502) 2021-08-02 21:44:13 -07:00
deephash.go util/deephash: hash uint{8,16,32,64} explicitly (#2502) 2021-08-02 21:44:13 -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