Open
Conversation
Member
|
Great! Where are the new benchmarks ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In the benchmarks below, this new algorithm improves very significantly about
containsperformance.Daniel Lemire, "You can beat the binary search," in Daniel Lemire's blog, April 27, 2026, https://lemire.me/blog/2026/04/27/you-can-beat-the-binary-search/.
On Apple M4, the optimized "After" version delivered substantial performance gains over the "Before" reference across most Contains operations with the census1881 dataset (200 bitmaps). ContainsColdLow improved from 111.6 ns/query to 60.4 ns/query (~46% faster), ContainsColdMod from 146.7 ns to 103.5 ns (~29% faster), ContainsWarmLow from 55.1 ns to 33.0 ns (~40% faster), and ContainsWarmMod from 137.0 ns to 57.5 ns (over 2× faster), while ContainsHigh cases remained essentially unchanged. On Intel with GCC, similar improvements were observed: ContainsColdLow dropped from 47.9 ns/query to 33.7 ns (~30% faster), ContainsColdMod from 108.4 ns to 71.2 ns (~34% faster), ContainsWarmLow from 34.0 ns to 15.8 ns (over 2× faster), and ContainsWarmMod from 50.9 ns to 21.3 ns (also >2× faster), with ContainsHigh again showing negligible change. Overall, the optimizations yielded major speedups on both the M4 and Intel platforms, particularly for the Low and Mod access patterns in both cold and warm scenarios. The reason we see no gain in the dense benchmarks is that we are measuring bitset performance.
Apple M4
Before
After
Intel (GCC)
Before
After