modif test

This commit is contained in:
Giuseppe 2015-12-01 09:38:36 +01:00
parent 9e28bbffcf
commit bee3326f4b
1 changed files with 5 additions and 5 deletions

View File

@ -1618,15 +1618,15 @@ func BenchmarkDeleteExpired(b *testing.B) {
func BenchmarkLargeCache(b *testing.B) { func BenchmarkLargeCache(b *testing.B) {
b.StopTimer() b.StopTimer()
tc := New(200 * time.Millisecond, 50 * time.Millisecond) tc := New(100 * time.Millisecond, 1 * time.Millisecond)
//tc.mu.Lock() //tc.mu.Lock()
for i := 0; i < 100000; i++ { for i := 0; i < 1000000; i++ {
tc.set(strconv.Itoa(i), "bar", DefaultExpiration) tc.Set(strconv.Itoa(i), "bar", DefaultExpiration)
} }
//tc.mu.Unlock() //tc.mu.Unlock()
tc.DeleteExpired() tc.DeleteExpired()
b.StartTimer() b.StartTimer()
for i := 100000; i <100000 + b.N; i++ { for i := 1000000; i <1000000 + b.N; i++ {
tc.set(strconv.Itoa(i), "bar", DefaultExpiration) tc.Set(strconv.Itoa(i), "bar", DefaultExpiration)
} }
} }