From cf4e16575494047186a7f4279a1e423fc2f638df Mon Sep 17 00:00:00 2001 From: Patrick Mylund Nielsen Date: Sat, 28 Nov 2015 14:56:23 -0500 Subject: [PATCH] Add IncrementInt benchmark --- cache_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cache_test.go b/cache_test.go index 0cccf5f..86a5283 100644 --- a/cache_test.go +++ b/cache_test.go @@ -1592,6 +1592,16 @@ func BenchmarkRWMutexMapSetDeleteSingleLock(b *testing.B) { } } +func BenchmarkIncrementInt(b *testing.B) { + b.StopTimer() + tc := New(DefaultExpiration, 0) + tc.Set("foo", 0, DefaultExpiration) + b.StartTimer() + for i := 0; i < b.N; i++ { + tc.IncrementInt("foo", 1) + } +} + func BenchmarkDeleteExpired(b *testing.B) { b.StopTimer() tc := New(1, 0)