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>
pull/1908/head
Josh Bleecher Snyder 3 years ago committed by Josh Bleecher Snyder
parent cb97062bac
commit 7891b34266

@ -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)
}
}

Loading…
Cancel
Save