aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/cache/cache_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/pkg/cache/cache_test.go')
-rw-r--r--plugin/pkg/cache/cache_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugin/pkg/cache/cache_test.go b/plugin/pkg/cache/cache_test.go
index 2c92bf438..0c56bb9b3 100644
--- a/plugin/pkg/cache/cache_test.go
+++ b/plugin/pkg/cache/cache_test.go
@@ -29,3 +29,13 @@ func TestCacheLen(t *testing.T) {
t.Fatalf("Cache size should %d, got %d", 2, l)
}
}
+
+func BenchmarkCache(b *testing.B) {
+ b.ReportAllocs()
+
+ c := New(4)
+ for n := 0; n < b.N; n++ {
+ c.Add(1, 1)
+ c.Get(1)
+ }
+}