Repository navigation
perf(patches): take PiecewiseSequenceArray runs without expanding them - #11547
Open
robert3005 wants to merge 5 commits into
Open
robert3005 wants to merge 5 commits into
robert3005 wants to merge 5 commits into
Conversation
Adds take_piecewise benchmarks that take Patches with ascending PiecewiseSequenceArray runs, next to take_piecewise_materialized, which expands the same indices to a primitive array first. Patches::take currently materializes piecewise indices itself, so the two match; the follow-up optimisation takes the runs without expanding them. Counts the 12 new benchmarks in scripts/codspeed_bench_counts.json for the CodSpeed shard planner. Signed-off-by: Robert Kruszewski <github@robertk.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gz5XNZn5EvWEDxkeJkJAFe
Patches::take and take_with_nulls now recognise PiecewiseSequenceArray indices made of ascending, non-overlapping, unit-multiplier runs and merge them with the sorted patch indices by galloping along both, so the cost depends on the number of runs and patches rather than the number of indices. The matched values are taken as a slice for a single run and as a PiecewiseSequenceArray of contiguous runs otherwise. Other piecewise indices fall back to the materialized take, as the fixed-width and chunked take kernels already do via maybe_contiguous_slices. take and take_with_nulls now share one implementation, and the chunked take's contiguous_runs helper moves to the piecewise_sequence module so both callers share it. Signed-off-by: Robert Kruszewski <github@robertk.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gz5XNZn5EvWEDxkeJkJAFe
robert3005
force-pushed
the
rk/patches-piecewise-take-bench
branch
from
November 18, 2026 09:22
f9667e5 to
583e8a0
Compare
robert3005
force-pushed
the
claude/intelligent-johnson-cbr0hl
branch
from
November 18, 2026 09:22
feebf22 to
0c14f56
Compare
Keep only take_piecewise at patch density 0.1 with run lengths 1, 16 and 256. CodSpeed compares each benchmark against its base, so the materialized variant and the second density added little. Signed-off-by: Robert Kruszewski <github@robertk.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gz5XNZn5EvWEDxkeJkJAFe
…t-johnson-cbr0hl Signed-off-by: Robert Kruszewski <github@robertk.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gz5XNZn5EvWEDxkeJkJAFe
robert3005
marked this pull request as ready for review
November 18, 2026 10:37
Merging this PR will improve performance by ×2.11 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
robert3005
added a commit
that referenced
this pull request
Nov 19, 2026
## Summary Baseline benchmarks for taking `Patches` with `PiecewiseSequenceArray` indices, ahead of the stacked follow-up #11547, which takes the runs without expanding them. Landing the benchmarks first gives that change a recorded baseline to compare against. ## Changes - Adds `take_piecewise` to `vortex-array/benches/take_patches.rs`. It takes patches at density 0.1 with ascending runs of contiguous indices, covering half of a 4096-row array, for run lengths 1, 16 and 256. - Inputs go through `mark_optimized`, like the existing benchmarks in this file. --------- Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
This branch has not been deployed
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.
Patches::takeexpandedPiecewiseSequenceArrayindices into one index per element before it searched the patches. Sorted, non-overlapping runs are now merged with the sorted patch indices directly, so the cost depends on the number of runs and patches, not on the number of indices. Other piecewise indices fall back to the existing take, andSparseArray::takegets the same benefit.🤖 Generated with Claude Code