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

Function BenchmarkRWMutexMapSet

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

Source from the content-addressed store, hash-verified

1608}
1609
1610func BenchmarkRWMutexMapSet(b *testing.B) {
1611 b.StopTimer()
1612 m := map[string]string{}
1613 mu := sync.RWMutex{}
1614 b.StartTimer()
1615 for i := 0; i < b.N; i++ {
1616 mu.Lock()
1617 m["foo"] = "bar"
1618 mu.Unlock()
1619 }
1620}
1621
1622func BenchmarkCacheSetDelete(b *testing.B) {
1623 b.StopTimer()

Callers

nothing calls this directly

Calls 1

LockMethod · 0.80

Tested by

no test coverage detected