MCPcopy Index your code
hub / github.com/upper/db / BenchmarkWriteNewValue

Function BenchmarkWriteNewValue

internal/cache/cache_test.go:104–112  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

102}
103
104func 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
114func BenchmarkReadExistentValue(b *testing.B) {
115 key := cacheableT{"foo"}

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.95
NewCacheFunction · 0.85

Tested by

no test coverage detected