finds.dev← search

// the find

RoaringBitmap/roaring

★ 2,891 · Go · Apache-2.0 · updated Jun 2026

Roaring bitmaps in Go (golang), used by InfluxDB, Bleve, DataDog

Go implementation of Roaring bitmaps, the compressed bitset format used in Lucene, Druid, InfluxDB, and a dozen other serious data systems. It stores sets of unsigned integers with fast set operations (AND, OR, XOR, NOT) by partitioning data into 65536-element chunks and choosing the most compact representation per chunk. If you're building anything that needs fast set intersection on large integer domains — indexing, filtering, tag systems — this is the right tool.

Binary-compatible with the Java and C++ Roaring implementations via a published format spec, so you can serialize in Go and deserialize in Java without conversion code. Three container types (array, bitmap, run-length) are selected automatically per chunk, so the structure self-optimizes for both sparse and dense distributions without configuration. ParOr and ParAnd expose parallel aggregation across many bitmaps using a worker pool, which matters when you're doing multi-term query intersection. CI matrix covers ARM, Windows, macOS, and big-endian, which is unusual and means you're not going to hit surprise failures on non-amd64 targets.

The 64-bit variant (roaring64) is not cross-language compatible — explicitly documented as not interoperable with Java or C++ — which is a sharp edge if you're in a polyglot system and assumed otherwise. No goroutine safety on Bitmap operations; you must bring your own mutex or channel discipline, and the docs bury this fact at the end of a long README rather than in the type-level godoc where you'd actually see it. The `Validate()` call after deserialization from untrusted input is mentioned as optional but really isn't — the README says 'necessary for security' in passing, which understates the risk. BitSliceIndexing package is present but barely documented, making it hard to evaluate whether it's production-ready or an experiment.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →