(b *testing.B)
| 186 | } |
| 187 | |
| 188 | func Benchmark_freelist_hashmapGetFreePageIDs(b *testing.B) { |
| 189 | f := newTestHashMapFreelist() |
| 190 | N := int32(100000) |
| 191 | fm := make(map[common.Pgid]uint64) |
| 192 | i := int32(0) |
| 193 | val := int32(0) |
| 194 | for i = 0; i < N; { |
| 195 | val = rand.Int31n(1000) |
| 196 | fm[common.Pgid(i)] = uint64(val) |
| 197 | i += val |
| 198 | } |
| 199 | |
| 200 | f.forwardMap = fm |
| 201 | |
| 202 | b.ReportAllocs() |
| 203 | b.ResetTimer() |
| 204 | for n := 0; n < b.N; n++ { |
| 205 | f.freePageIds() |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | func Benchmark_freelist_hashmapMergeSpans(b *testing.B) { |
| 210 | type testCase struct { |
nothing calls this directly
no test coverage detected