tailscale/util/deephash
Joe Tsai 548fa63e49
util/deephash: use binary encoding of time.Time (#5352)
Formatting a time.Time as RFC3339 is slow.
See https://go.dev/issue/54093

Now that we have efficient hashing of fixed-width integers,
just hash the time.Time as a binary value.

Performance:

	Hash-24                19.0µs ± 1%    18.6µs ± 1%   -2.03%  (p=0.000 n=10+9)
	TailcfgNode-24         1.79µs ± 1%    1.40µs ± 1%  -21.74%  (p=0.000 n=10+9)

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2022-08-12 14:42:51 -07:00
..
testtype util/deephash: fix unexported time.Time hashing 2022-07-27 09:28:23 -07:00
deephash_test.go util/deephash: use binary encoding of time.Time (#5352) 2022-08-12 14:42:51 -07:00
deephash.go util/deephash: use binary encoding of time.Time (#5352) 2022-08-12 14:42:51 -07:00