Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The two common operations for building inverted indexes are compressing and decompressing ID lists, and intersecting them. In addition to the already-present intersection implementation, this PR adds a wrapper around an integer list compressor, streamvbyte, also by Daniel Lemire.
FAQ
Is this orthogonal to the purposes of the library?
Probably, but I want them both so I don't care very much.
Why not use a Rust compressor?
https://github.com/tantivy-search/bitpacking from Tantivy seems hard to use (requires knowledge of the internal block size used by the compressor). The existing Rust port of stream-vbyte doesn't seem maintained, and also requires unstable Rust. I think it might be possible to get it to compile on stable, given that some SIMD stuff has stabilized since it was last touched, but I tried for a couple of hours and gave up.
Why not use one of the C++ compressors in the library you're already wrapping?
This library started out as a wrapper around https://github.com/lemire/SIMDCompressionAndIntersection which already contains a bunch of implementations of integer list compressors, including one for streamvbyte. The C++ implementation is apparently not vectorized though, per fast-pack/SIMDCompressionAndIntersection#22, so I opted for the C one instead under the assumption that it will be faster.