MCPcopy Create free account
hub / github.com/evilsocket/sum / BenchmarkIndexPathForId

Function BenchmarkIndexPathForId

storage/index_benchmark_test.go:21–28  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

19}
20
21func BenchmarkIndexPathForId(b *testing.B) {
22 i := setupIndex("/foo")
23 for n := 0; n < b.N; n++ {
24 if s := i.pathForID(uint64(n%666) + 1); s == "" {
25 b.Fatal("just to make sure the compiler doesn't optimize it away :D")
26 }
27 }
28}
29
30func BenchmarkIndexPathFor(b *testing.B) {
31 i := setupIndex("/foo")

Callers

nothing calls this directly

Calls 2

setupIndexFunction · 0.85
pathForIDMethod · 0.80

Tested by

no test coverage detected