Skip to content

Compare performance with the pure Go roaring library in the README - #33

Merged
lemire merged 1 commit into
masterfrom
readme-go-comparison
Nov 4, 2026
Merged

lemire merged 1 commit into
masterfrom
readme-go-comparison

Conversation

@lemire

@lemire lemire commented Nov 4, 2026

Copy link
Copy Markdown
Member

Replaces the README's link-only "Benchmarking" section with a comparison between gocroaring and roaring, the pure Go library. It covers when each one is faster and gives a table of timings.

The numbers come from the new benchmarks/compare directory:

  • 58 benchmarks, each running the same operation on identical data through both libraries.
  • Medians of 10 runs on one core of a Xeon Gold 6548N, with gocroaring 1.1.0 (CRoaring 5.5.1) and roaring 2.30.0.

gocroaring is faster in 44 of them and roaring in 12 (2 within 5%), with a geometric-mean ratio of 1.7 in favor of gocroaring:

  • gocroaring is ahead by 2× to 12× on whole-bitmap operations.
  • roaring wins on calls that do very little work, where the cost of crossing from Go into C (about 40 ns) dominates. It also wins on unions of very sparse 64-bit bitmaps.

benchmarks/compare is a separate module (with a replace pointing at the repository root), so gocroaring does not gain a dependency on roaring. go test ./... at the root does not enter it.

Replace the link-only "Benchmarking" section with a summary of when
gocroaring or roaring is faster, and a table of timings measured on a
Xeon Gold 6548N with gocroaring 1.1.0 (CRoaring 5.5.1) and roaring
2.30.0.

Add the benchmarks behind it in benchmarks/compare: 58 side-by-side
benchmarks on identical data. They live in a separate module so that
gocroaring itself does not depend on roaring.
@lemire
lemire merged commit 3feefed into master Nov 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant