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

Function BenchmarkIndexPathFor

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

Source from the content-addressed store, hash-verified

28}
29
30func BenchmarkIndexPathFor(b *testing.B) {
31 i := setupIndex("/foo")
32 for n := 0; n < b.N; n++ {
33 testRecord.Id = uint64(n%666) + 1
34 if s := i.pathFor(&testRecord); s == "" {
35 b.Fatal("just to make sure the compiler doesn't optimize it away :D")
36 }
37 }
38}
39
40func BenchmarkIndexForEach(b *testing.B) {
41 setupRecords(b, true, false)

Callers

nothing calls this directly

Calls 2

setupIndexFunction · 0.85
pathForMethod · 0.80

Tested by

no test coverage detected