Repository navigation
bench(patches): add baseline for piecewise take - #11546
robert3005 wants to merge 1 commit 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. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gz5XNZn5EvWEDxkeJkJAFe
Merging this PR will improve performance by 10.48%2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
Summary
Baseline benchmarks for taking
PatcheswithPiecewiseSequenceArrayindices, ahead of the stacked follow-up that takes the runs without expanding them. Landing the benchmarks first gives that change a recorded baseline to compare against.Changes
Adds two benchmarks to
vortex-array/benches/take_patches.rs, over patch densities 0.1 and 0.01 and run lengths 1, 16 and 256. The indices are ascending runs of contiguous positions covering half of a 4096-row array.take_piecewisecallsPatches::takewith thePiecewiseSequenceArraydirectly.take_piecewise_materializedexpands the same indices to aPrimitiveArrayfirst.Patches::takecurrently materializes piecewise indices itself, so ondevelopthe two measure the same: about 8–33 µs per take, depending on density and run length.Inputs go through
mark_optimized, like the existing benchmarks in this file.Checks run:
cargo clippy -p vortex-array --bench take_patches -- -D warnings,cargo +nightly-2026-11-13 fmt -p vortex-array, and the benchmark itself.Generated by Claude Code