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

Function BenchmarkWrappedRecordsLoopWithAll

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

Source from the content-addressed store, hash-verified

27}
28
29func BenchmarkWrappedRecordsLoopWithAll(b *testing.B) {
30 setupRecords(b, true)
31 defer teardownRecords(b)
32
33 records, err := storage.LoadRecords(testFolder)
34 if err != nil {
35 b.Fatal(err)
36 }
37 wrapped := WrapRecords(records)
38
39 b.ResetTimer()
40 for i := 0; i < b.N; i++ {
41 if all := wrapped.All(); len(all) != testRecords {
42 b.Fatalf("expected %d wrapped records, got %d", testRecords, len(all))
43 }
44 }
45}
46
47func BenchmarkWrappedRecordsLoopWithAllBut(b *testing.B) {
48 setupRecords(b, true)

Callers

nothing calls this directly

Calls 4

WrapRecordsFunction · 0.85
AllMethod · 0.80
setupRecordsFunction · 0.70
teardownRecordsFunction · 0.70

Tested by

no test coverage detected