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

Function BenchmarkRWMutexInterfaceMapGetString

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

Source from the content-addressed store, hash-verified

1489}
1490
1491func BenchmarkRWMutexInterfaceMapGetString(b *testing.B) {
1492 b.StopTimer()
1493 m := map[interface{}]string{
1494 "foo": "bar",
1495 }
1496 mu := sync.RWMutex{}
1497 b.StartTimer()
1498 for i := 0; i < b.N; i++ {
1499 mu.RLock()
1500 _, _ = m["foo"]
1501 mu.RUnlock()
1502 }
1503}
1504
1505func BenchmarkCacheGetConcurrentExpiring(b *testing.B) {
1506 benchmarkCacheGetConcurrent(b, 5*time.Minute)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected