RoaringBitmap / CRoaring

Roaring bitmaps in C (and C++), with SIMD (AVX2, AVX-512 and NEON) optimizations: used by Apache Doris, ClickHouse, and StarRocks

Home Page:http://roaringbitmap.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

microbenchmark

longqimin opened this issue · comments

commented

i found roaring_bitmap_and_cardinality() benchmark slower than roaring_bitmap_and() + roaring_bitmap_get_cardinality(), is this reasonable?

~/s/t/CRoaring ((4fdf6ffb)|✔) $ ./build/microbenchmarks/bench
2023-04-05T15:51:48+08:00
Running ./build/microbenchmarks/bench
Run on (48 X 3000 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x48)
  L1 Instruction 32 KiB (x48)
  L2 Unified 4096 KiB (x48)
  L3 Unified 16384 KiB (x48)
Load Average: 0.27, 1.42, 5.63
AVX-2 hardware: yes
AVX-512: supported by compiler
AVX-512 hardware: no
In RAM volume in MiB (estimated): 1.802828
benchmarking other files: You may pass is a data directory as a parameter.
data source: /home/longqimin00/stdb/thirdparty/CRoaring/benchmarks/realdata/census1881
number of bitmaps: 200
performance counters: No privileged access (sudo may help).
x64: detected
----------------------------------------------------------------------------
Benchmark                                  Time             CPU   Iterations
----------------------------------------------------------------------------
SuccessiveIntersection                 25549 ns        25491 ns        27321
SuccessiveIntersectionCardinality      28714 ns        28654 ns        24485
SuccessiveUnionCardinality             41574 ns        41460 ns        17880
SuccessiveDifferenceCardinality        34451 ns        34363 ns        20397
SuccessiveUnion                       473435 ns       471382 ns         1488
TotalUnion                            568666 ns       565881 ns         1313
TotalUnionHeap                       1618086 ns      1610175 ns          431
RandomAccess                            2545 ns         2539 ns       273106
ToArray                               132780 ns       132244 ns         5209
IterateAll                           1985539 ns      1977863 ns          356
ComputeCardinality                      3466 ns         3452 ns       202821

No, it is not reasonable but make sure sure you are testing on a server configured for testing.

You are not benchmarking on a laptop, are you?

If you cannot resolve your issue, please open a new issue with a detailed description of your configuration (hardware, processor, operating system, compiler). The measurements must not be taken on a laptop.

Ideally, run your benchmarks on something like AWS so that we can reproduce your results.