(b *testing.B)
| 7 | ) |
| 8 | |
| 9 | func 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 | |
| 29 | func BenchmarkWrappedRecordsLoopWithAll(b *testing.B) { |
| 30 | setupRecords(b, true) |
nothing calls this directly
no test coverage detected