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

Function BenchmarkIntersectionLargeParallel

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

Source from the content-addressed store, hash-verified

6)
7
8func BenchmarkIntersectionLargeParallel(b *testing.B) {
9 b.StopTimer()
10
11 initsize := 650000
12 r := rand.New(rand.NewSource(0))
13
14 s1 := NewBitmap()
15 sz := 150 * 1000 * 1000
16 for i := 0; i < initsize; i++ {
17 s1.Add(uint32(r.Int31n(int32(sz))))
18 }
19
20 s2 := NewBitmap()
21 sz = 100 * 1000 * 1000
22 for i := 0; i < initsize; i++ {
23 s2.Add(uint32(r.Int31n(int32(sz))))
24 }
25
26 b.StartTimer()
27 card := uint64(0)
28 for j := 0; j < b.N; j++ {
29 s3 := ParAnd(0, s1, s2)
30 card = card + s3.GetCardinality()
31 }
32}
33
34func BenchmarkIntersectionLargeRoaring(b *testing.B) {
35 b.StopTimer()

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
ParAndFunction · 0.85
NewBitmapFunction · 0.70
GetCardinalityMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…