MCPcopy Create free account
hub / github.com/patrickmn/go-cache / BenchmarkCacheSetDeleteSingleLock

Function BenchmarkCacheSetDeleteSingleLock

cache_test.go:1631–1641  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1629}
1630
1631func BenchmarkCacheSetDeleteSingleLock(b *testing.B) {
1632 b.StopTimer()
1633 tc := New(DefaultExpiration, 0)
1634 b.StartTimer()
1635 for i := 0; i < b.N; i++ {
1636 tc.mu.Lock()
1637 tc.set("foo", "bar", DefaultExpiration)
1638 tc.delete("foo")
1639 tc.mu.Unlock()
1640 }
1641}
1642
1643func BenchmarkRWMutexMapSetDeleteSingleLock(b *testing.B) {
1644 b.StopTimer()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
setMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…