MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / BenchmarkCacheSetDeleteSingleLock

Function BenchmarkCacheSetDeleteSingleLock

pkg/util/cache/cache_test.go:1647–1657  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1645}
1646
1647func BenchmarkCacheSetDeleteSingleLock(b *testing.B) {
1648 b.StopTimer()
1649 tc := New(DefaultExpiration, 0)
1650 b.StartTimer()
1651 for i := 0; i < b.N; i++ {
1652 tc.mu.Lock()
1653 tc.set("foo", "bar", DefaultExpiration)
1654 tc.delete("foo")
1655 tc.mu.Unlock()
1656 }
1657}
1658
1659func BenchmarkRWMutexMapSetDeleteSingleLock(b *testing.B) {
1660 b.StopTimer()

Callers

nothing calls this directly

Calls 4

LockMethod · 0.80
deleteMethod · 0.80
NewFunction · 0.70
setMethod · 0.45

Tested by

no test coverage detected