diff --git a/bench/bench_test.go b/bench/bench_test.go index b684608..fe03899 100644 --- a/bench/bench_test.go +++ b/bench/bench_test.go @@ -46,7 +46,7 @@ func BenchmarkCloudflareGet(b *testing.B) { expires := time.Now().Add(time.Hour) for pb.Next() { i := int(fastrandn(cachesize)) - if i >= cachesize/4 { + if i >= cachesize/10 { cache.Get(keymap[i]) } else { cache.Set(keymap[i], i, expires) @@ -65,7 +65,7 @@ func BenchmarkEcacheGet(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { i := int(fastrandn(cachesize)) - if i >= cachesize/4 { + if i >= cachesize/10 { cache.Get(keymap[i]) } else { cache.Put(keymap[i], i) @@ -90,7 +90,7 @@ func BenchmarkRistrettoGet(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { i := int(fastrandn(cachesize)) - if i >= cachesize/4 { + if i >= cachesize/10 { cache.Get(keymap[i]) } else { cache.SetWithTTL(keymap[i], i, 1, time.Hour) @@ -111,7 +111,7 @@ func BenchmarkTheineGet(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { i := int(fastrandn(cachesize)) - if i >= cachesize/4 { + if i >= cachesize/10 { cache.Get(keymap[i]) } else { cache.SetWithTTL(keymap[i], i, 1, time.Hour) @@ -132,7 +132,7 @@ func BenchmarkOtterGet(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { i := int(fastrandn(cachesize)) - if i >= cachesize/4 { + if i >= cachesize/10 { cache.Get(keymap[i]) } else { cache.SetWithTTL(keymap[i], i, time.Hour) @@ -157,7 +157,7 @@ func BenchmarkFreelruGet(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { i := int(fastrandn(cachesize)) - if i >= cachesize/4 { + if i >= cachesize/10 { cache.Get(keymap[i]) } else { cache.AddWithLifetime(keymap[i], i, time.Hour) @@ -178,7 +178,7 @@ func BenchmarkPhusluGet(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { i := int(fastrandn(cachesize)) - if i >= cachesize/4 { + if i >= cachesize/10 { cache.Get(keymap[i]) } else { cache.SetWithTTL(keymap[i], i, time.Hour)