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

Function benchmarkCacheGet

pkg/util/cache/cache_test.go:1452–1460  ·  view source on GitHub ↗
(b *testing.B, exp time.Duration)

Source from the content-addressed store, hash-verified

1450}
1451
1452func benchmarkCacheGet(b *testing.B, exp time.Duration) {
1453 b.StopTimer()
1454 tc := New(exp, 0)
1455 tc.Set("foo", "bar", DefaultExpiration)
1456 b.StartTimer()
1457 for i := 0; i < b.N; i++ {
1458 tc.Get("foo")
1459 }
1460}
1461
1462func BenchmarkRWMutexMapGet(b *testing.B) {
1463 b.StopTimer()

Callers 2

Calls 3

NewFunction · 0.70
SetMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected