perf(sequence): build single-match bitmap directly - #9262
Open
tomatotomata wants to merge 2 commits into
Open
Conversation
| } | ||
|
|
||
| const NUM_VALUES: u64 = 100_000; | ||
| const SEQUENCE_COMPARE_LENGTHS: [usize; 3] = [1_000, 100_000, 1_000_000]; |
Author
There was a problem hiding this comment.
Switched both comparison cases to the existing NUM_VALUES workload in b7f33d0.
Contributor
There was a problem hiding this comment.
please read the benchmarking docs
Author
There was a problem hiding this comment.
Read docs/developer-guide/benchmarking.md and updated both cases to pass the length and match index through with_inputs, removing the captured values and std::hint::black_box. The focused run measured 19.99 microseconds median for from_iter and 87.3 nanoseconds for the single-set path, both below the 1 ms per-iteration limit.
Comment on lines
+59
to
+61
| let mut buffer = BitBufferMut::new_unset(lhs.len()); | ||
| buffer.set(set_idx); | ||
| let buffer = buffer.freeze(); |
Signed-off-by: ahmad <ahmadalgaidy@hotmail.com>
Signed-off-by: ahmad <ahmadalgaidy@hotmail.com>
tomatotomata
force-pushed
the
codex/sequence-compare-single-bit
branch
from
August 8, 2026 00:03
b7f33d0 to
e1d3874
Compare
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.
Summary
The sequence equality kernel knows that a match bitmap contains exactly one set bit, but it currently evaluates a predicate for every row to build that bitmap. This change allocates an unset
BitBufferMut, sets the known match index, and freezes it. The existing iterator construction remains in the throughput benchmark as a baseline, alongside the single-set path at 1K, 100K, and 1M rows.Testing
rustfmton both changed filesgit diff --checkcargo test -p vortex-sequence --lib --no-default-features compute::compare::testswas attempted twice but could not complete because the shallow checkout needs the uncachedtpchgenGit dependency.AI assistance
This PR was prepared with agentic AI assistance. I inspected the issue and surrounding implementation, kept the change scoped to the requested path, and recorded the local validation limitation above.
Fixes #9092