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

Function BenchmarkWrappedRecordsFind

wrapper/records_benchmark_test.go:9–27  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

7)
8
9func BenchmarkWrappedRecordsFind(b *testing.B) {
10 setupRecords(b, true)
11 defer teardownRecords(b)
12
13 records, err := storage.LoadRecords(testFolder)
14 if err != nil {
15 b.Fatal(err)
16 }
17
18 wrapped := WrapRecords(records)
19
20 b.ResetTimer()
21 for i := 0; i < b.N; i++ {
22 id := uint64(i%testRecords) + 1
23 if r := wrapped.Find(id); r.IsNull() {
24 b.Fatalf("wrapped record with id %d not found", id)
25 }
26 }
27}
28
29func BenchmarkWrappedRecordsLoopWithAll(b *testing.B) {
30 setupRecords(b, true)

Callers

nothing calls this directly

Calls 5

WrapRecordsFunction · 0.85
IsNullMethod · 0.80
setupRecordsFunction · 0.70
teardownRecordsFunction · 0.70
FindMethod · 0.45

Tested by

no test coverage detected