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

Function benchmarkHashMapMergeSpansNonBatch

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

Source from the content-addressed store, hash-verified

299}
300
301func benchmarkHashMapMergeSpansNonBatch(b *testing.B, initIDs, mergePgids common.Pgids) {
302 b.ReportAllocs()
303 b.ResetTimer()
304 for i := 0; i < b.N; i++ {
305 b.StopTimer()
306 f := newTestHashMapFreelist()
307 f.Init(initIDs)
308
309 mergeIDs := append(common.Pgids(nil), mergePgids...)
310
311 b.StartTimer()
312 for _, id := range mergeIDs {
313 f.mergeWithExistingSpan(id, id)
314 }
315 }
316}
317
318func newTestHashMapFreelist() *hashMap {
319 f := NewHashMapFreelist()

Callers 1

Calls 4

PgidsTypeAlias · 0.92
newTestHashMapFreelistFunction · 0.85
mergeWithExistingSpanMethod · 0.80
InitMethod · 0.65

Tested by

no test coverage detected