MCPcopy
hub / github.com/RoaringBitmap/roaring / BenchmarkRepeatedSelfArrayUnion

Function BenchmarkRepeatedSelfArrayUnion

roaring_test.go:3803–3816  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

3801}
3802
3803func BenchmarkRepeatedSelfArrayUnion(b *testing.B) {
3804 bitmap := NewBitmap()
3805 for i := 0; i < 4096; i++ {
3806 bitmap.Add(uint32(2 * i))
3807 }
3808 b.ReportAllocs()
3809 b.ResetTimer()
3810 for i := 0; i < b.N; i++ {
3811 receiver := NewBitmap()
3812 for j := 0; j < 1000; j++ {
3813 receiver.Or(bitmap)
3814 }
3815 }
3816}
3817
3818// BenchmarkArrayIorMergeThreshold tests performance
3819// when unioning two array containers when the cardinality sum is over 4096

Callers

nothing calls this directly

Calls 3

AddMethod · 0.95
OrMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…