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

Function BenchmarkIntersectionLargeRoaring

parallel_benchmark_test.go:34–57  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

32}
33
34func BenchmarkIntersectionLargeRoaring(b *testing.B) {
35 b.StopTimer()
36 initsize := 650000
37 r := rand.New(rand.NewSource(0))
38
39 s1 := NewBitmap()
40 sz := 150 * 1000 * 1000
41 for i := 0; i < initsize; i++ {
42 s1.Add(uint32(r.Int31n(int32(sz))))
43 }
44
45 s2 := NewBitmap()
46 sz = 100 * 1000 * 1000
47 for i := 0; i < initsize; i++ {
48 s2.Add(uint32(r.Int31n(int32(sz))))
49 }
50
51 b.StartTimer()
52 card := uint64(0)
53 for j := 0; j < b.N; j++ {
54 s3 := And(s1, s2)
55 card = card + s3.GetCardinality()
56 }
57}

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
NewBitmapFunction · 0.70
AndFunction · 0.70
GetCardinalityMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…