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

Function BenchmarkRWMutexMapSetDeleteSingleLock

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

Source from the content-addressed store, hash-verified

1657}
1658
1659func BenchmarkRWMutexMapSetDeleteSingleLock(b *testing.B) {
1660 b.StopTimer()
1661 m := map[string]string{}
1662 mu := sync.RWMutex{}
1663 b.StartTimer()
1664 for i := 0; i < b.N; i++ {
1665 mu.Lock()
1666 m["foo"] = "bar"
1667 delete(m, "foo")
1668 mu.Unlock()
1669 }
1670}
1671
1672func BenchmarkIncrementInt(b *testing.B) {
1673 b.StopTimer()

Callers

nothing calls this directly

Calls 1

LockMethod · 0.80

Tested by

no test coverage detected