summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2021-05-07 21:38:18 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2021-05-10 09:43:44 -0700
commit7cd4766d5e8bd9cc41b57c87be29aa34f988e0f7 (patch)
tree1f76d9e884cadfbe6cf82a1e3deaee55d395662a
parent3173c5a65c2808a29807774e8cb614ab7db80c0b (diff)
downloadtailscale-7cd4766d5e8bd9cc41b57c87be29aa34f988e0f7.tar.xz
tailscale-7cd4766d5e8bd9cc41b57c87be29aa34f988e0f7.zip
types/wgkey: add BenchmarkShortString
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
-rw-r--r--types/wgkey/key_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/types/wgkey/key_test.go b/types/wgkey/key_test.go
index 1c4c2da59..c4bfa93da 100644
--- a/types/wgkey/key_test.go
+++ b/types/wgkey/key_test.go
@@ -171,3 +171,13 @@ func BenchmarkUnmarshalJSON(b *testing.B) {
}
}
}
+
+var sinkString string
+
+func BenchmarkShortString(b *testing.B) {
+ b.ReportAllocs()
+ var k Key
+ for i := 0; i < b.N; i++ {
+ sinkString = k.ShortString()
+ }
+}