tailscale/util/deephash
Joe Tsai 77a92f326d
util/deephash: avoid using sync.Pool for reflect.MapIter (#5333)
In Go 1.19, the reflect.Value.MapRange method uses "function outlining"
so that the allocation of reflect.MapIter is inlinable by the caller.
If the iterator doesn't escape the caller, it can be stack allocated.
See https://go.dev/cl/400675

Performance:

	name               old time/op    new time/op    delta
	HashMapAcyclic-24    31.9µs ± 2%    32.1µs ± 1%   ~     (p=0.075 n=10+10)

	name               old alloc/op   new alloc/op   delta
	HashMapAcyclic-24     0.00B          0.00B        ~     (all equal)

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2022-08-11 00:33:40 -07:00
..
testtype util/deephash: fix unexported time.Time hashing 2022-07-27 09:28:23 -07:00
deephash_test.go util/deephash: always keep values addressable (#5328) 2022-08-09 22:00:02 -07:00
deephash.go util/deephash: avoid using sync.Pool for reflect.MapIter (#5333) 2022-08-11 00:33:40 -07:00