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

Function BenchmarkRWMutexInterfaceMapGetStruct

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

Source from the content-addressed store, hash-verified

1474}
1475
1476func BenchmarkRWMutexInterfaceMapGetStruct(b *testing.B) {
1477 b.StopTimer()
1478 s := struct{ name string }{name: "foo"}
1479 m := map[interface{}]string{
1480 s: "bar",
1481 }
1482 mu := sync.RWMutex{}
1483 b.StartTimer()
1484 for i := 0; i < b.N; i++ {
1485 mu.RLock()
1486 _, _ = m[s]
1487 mu.RUnlock()
1488 }
1489}
1490
1491func BenchmarkRWMutexInterfaceMapGetString(b *testing.B) {
1492 b.StopTimer()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected