internal/deepprint: add BenchmarkHash

deepprint currently accounts for 15% of allocs in tailscaled.
This is a useful benchmark to have.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder 2021-05-07 18:05:04 -07:00 committed by Josh Bleecher Snyder
parent cb97062bac
commit 7891b34266

View File

@ -62,3 +62,11 @@ func getVal() []interface{} {
}, },
} }
} }
func BenchmarkHash(b *testing.B) {
b.ReportAllocs()
v := getVal()
for i := 0; i < b.N; i++ {
Hash(v)
}
}