(b *testing.B)
| 102 | } |
| 103 | |
| 104 | func BenchmarkWriteNewValue(b *testing.B) { |
| 105 | value := "bar" |
| 106 | |
| 107 | z := NewCache() |
| 108 | for i := 0; i < b.N; i++ { |
| 109 | key := cacheableT{fmt.Sprintf("item-%d", i)} |
| 110 | z.Write(&key, value) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | func BenchmarkReadExistentValue(b *testing.B) { |
| 115 | key := cacheableT{"foo"} |