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 <[email protected]>
This commit is contained in:
Josh Bleecher Snyder authored and Josh Bleecher Snyder committed 2021-05-11 11:33:17 -07:00
1 parent cb97062bac
commit 7891b34266
1 file changed
+8
+8
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)
}
}