1 // Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
2 // All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file.
15 func BenchmarkLRUCache(b *testing.B) {
16 c := NewCache(NewLRU(10000))
19 b.RunParallel(func(pb *testing.PB) {
20 r := rand.New(rand.NewSource(time.Now().UnixNano()))
23 key := uint64(r.Intn(1000000))
24 c.Get(0, key, func() (int, Value) {