MCPcopy
hub / github.com/etcd-io/bbolt / benchmarkHashMapMergeSpans

Function benchmarkHashMapMergeSpans

internal/freelist/hashmap_test.go:286–299  ·  view source on GitHub ↗
(b *testing.B, initIDs, mergePgids common.Pgids)

Source from the content-addressed store, hash-verified

284}
285
286func benchmarkHashMapMergeSpans(b *testing.B, initIDs, mergePgids common.Pgids) {
287 b.ReportAllocs()
288 b.ResetTimer()
289 for i := 0; i < b.N; i++ {
290 b.StopTimer()
291 f := newTestHashMapFreelist()
292 f.Init(initIDs)
293
294 mergeIDs := append(common.Pgids(nil), mergePgids...)
295
296 b.StartTimer()
297 f.mergeSpans(mergeIDs)
298 }
299}
300
301func benchmarkHashMapMergeSpansNonBatch(b *testing.B, initIDs, mergePgids common.Pgids) {
302 b.ReportAllocs()

Callers 1

Calls 4

PgidsTypeAlias · 0.92
newTestHashMapFreelistFunction · 0.85
InitMethod · 0.65
mergeSpansMethod · 0.65

Tested by

no test coverage detected