Repository navigation
Benchmark integer statistics with and without nulls on CodSpeed - #10341
Merged
Merged
Conversation
The compressor benchmarks are excluded from CodSpeed, and none covers nullable arrays. Add one benchmark of integer statistics over a non-null array, and one over the same array with one value in ten null, and run the compressor benchmarks in a CodSpeed shard. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018J6qahqrVFb4UCPkwUzY11
connortsui20
reviewed
Oct 6, 2026
| IntegerStats::generate_opts( | ||
| array, | ||
| GenerateStatsOptions { | ||
| count_distinct_values: false, |
Member
There was a problem hiding this comment.
probably want this a true since we ALWAYS have this set to true in the compressor
connortsui20
approved these changes
Oct 6, 2026
connortsui20
left a comment
Member
There was a problem hiding this comment.
probably should also add the count distinct value bench later
This was referenced Oct 6, 2026
connortsui20
pushed a commit
that referenced
this pull request
Oct 7, 2026
## Summary Stacked on #10341, which adds the benchmarks. Integer statistics with nulls sliced the validity `BitBuffer` for every chunk of 64 values to count its set bits, then tested each value's bit with a branch. With nulls spread out, almost no chunk is fully valid (0.9⁶⁴ ≈ 0.1% at 10% nulls), so nearly every chunk took that slow path. ## Changes In `vortex-compressor/src/stats/integer.rs`: - Read the validity one `u64` word per chunk instead of slicing a bit buffer. A word of zeros is skipped, and a full word takes the non-null loop as before. - Without distinct values, fill each null with the valid value before it. A filled null adds no run, so the chunk takes the same branch-free run count as a non-null chunk. - With distinct values, push only the set bits, since a filled null would count as an occurrence. - The trailing values are padded into a last chunk whose padding is null. This replaces the separate per-bit remainder loop. Min/max is unchanged: it is still computed by the `min_max` aggregate before this loop. `test_matches_naive_reference` now also covers statistics without distinct values and chunks that are entirely null. Filling the nulls with their own values instead makes 38 of its cases fail. --------- Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
No benchmark tracks the integer compression statistics in CI. The
vortex-compressorbenchmarks are all#[cfg(not(codspeed))], the package is not in any CodSpeed shard, andstats_calconly builds non-nullable arrays. This adds a small benchmark CodSpeed runs, so the follow-up PR that speeds up the nullable path has a baseline.Changes
vortex-compressor/benches/integer_stats.rs: two benchmarks ofIntegerStats::generate_optsover 64Kiu32values in short runs (up to 8, 1024 distinct):integer_stats_non_nullinteger_stats_nullable: the same values with one in ten null at random, so almost every chunk of 64 values has a null.Each iteration builds a fresh array, so the min/max cached on the array by a previous iteration is not reused.
.github/workflows/codspeed.yml: addvortex-compressorto shard 6. Its other benchmarks stay excluded from CodSpeed.