Skip to content

Add PiecewiseSequence take microbenchmarks#8830

Merged
robert3005 merged 5 commits into
developfrom
codex/piecewise-sequence-benchmarks
Jul 21, 2026
Merged

Add PiecewiseSequence take microbenchmarks#8830
robert3005 merged 5 commits into
developfrom
codex/piecewise-sequence-benchmarks

Conversation

@danking

@danking danking commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@robert3005 I'm not sure if you want to check these in. These are what I used to reason about various ways to copy slices of data from one spot in memory to another.

Summary

  • add piecewise_sequence_take_primitive to compare constant-length PiecewiseSequence take against dense lengths and reifying constant lengths
  • add take_slices_to_buffer_matrix to compare extend/cursor-copy loops with and without preverification plus unchecked slicing

Validation

  • cargo +nightly fmt --all
  • cargo clippy -p vortex-array --all-targets --all-features -- -D warnings
  • cargo bench -p vortex-array --bench piecewise_sequence_take_primitive
  • cargo bench -p vortex-array --bench take_slices_to_buffer_matrix

@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from 18df62f to 04a21ec Compare July 17, 2026 19:12
@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch from 9adf56d to c4a0358 Compare July 17, 2026 19:40
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from 0906157 to f5c8555 Compare July 17, 2026 19:40
@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch 2 times, most recently from 80f7b89 to 30870aa Compare July 17, 2026 20:19
@danking danking added the changelog/chore A trivial change label Jul 17, 2026
@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch from 30870aa to e777ab4 Compare July 17, 2026 20:25
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from f5c8555 to b59c45f Compare July 17, 2026 20:33
@danking
danking requested a review from robert3005 July 17, 2026 20:37
@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch from e777ab4 to e4a0543 Compare July 17, 2026 20:37
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from b59c45f to 388d234 Compare July 17, 2026 20:41
@robert3005

Copy link
Copy Markdown
Contributor

I think we want benchmarks. I came up with the long term solution in #8825 and we have to make sure we don't regress

@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch from 490e9db to ed7bbe2 Compare July 20, 2026 16:11
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from 388d234 to 5f0d64e Compare July 20, 2026 16:11
@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch from ed7bbe2 to efafe71 Compare July 20, 2026 16:37
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from 5f0d64e to 245abc0 Compare July 20, 2026 16:37
@codspeed-hq

codspeed-hq Bot commented Jul 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 1788 untouched benchmarks
🆕 39 new benchmarks
⏩ 54 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
🆕 Simulation optimized_constant_lengths[1] N/A 427.3 µs N/A
🆕 Simulation optimized_constant_lengths[16] N/A 102.3 µs N/A
🆕 Simulation optimized_constant_lengths[256] N/A 87.6 µs N/A
🆕 Simulation optimized_constant_lengths[4] N/A 149.5 µs N/A
🆕 Simulation optimized_constant_lengths[64] N/A 89.9 µs N/A
🆕 Simulation prebuilt_dense_lengths[1] N/A 456.9 µs N/A
🆕 Simulation prebuilt_dense_lengths[16] N/A 103.7 µs N/A
🆕 Simulation prebuilt_dense_lengths[256] N/A 87.5 µs N/A
🆕 Simulation prebuilt_dense_lengths[4] N/A 156.5 µs N/A
🆕 Simulation prebuilt_dense_lengths[64] N/A 90 µs N/A
🆕 Simulation reify_constant_lengths_then_take[1] N/A 471.6 µs N/A
🆕 Simulation reify_constant_lengths_then_take[16] N/A 110.2 µs N/A
🆕 Simulation reify_constant_lengths_then_take[256] N/A 93.5 µs N/A
🆕 Simulation reify_constant_lengths_then_take[4] N/A 163.3 µs N/A
🆕 Simulation reify_constant_lengths_then_take[64] N/A 96.4 µs N/A
🆕 Simulation cursor_copy_safe[1000] N/A 6.9 µs N/A
🆕 Simulation cursor_copy_safe[10000] N/A 14.2 µs N/A
🆕 Simulation cursor_copy_safe[100000] N/A 86.6 µs N/A
🆕 Simulation extend_safe[1000] N/A 7.4 µs N/A
🆕 Simulation extend_safe[10000] N/A 14 µs N/A
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing codex/piecewise-sequence-benchmarks (c731e4f) with develop (ae9ecec)

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch from efafe71 to 56b0394 Compare July 20, 2026 16:56
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from 245abc0 to baaab82 Compare July 20, 2026 16:56
@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch from 56b0394 to 80bfa43 Compare July 20, 2026 18:10
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch 2 times, most recently from 0121842 to 4600066 Compare July 20, 2026 19:24
@danking
danking force-pushed the codex/piecewise-sequential-run-take-consumers branch from 80bfa43 to 09ca199 Compare July 20, 2026 19:24
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch 6 times, most recently from 431cbd5 to 4bb6ce4 Compare July 20, 2026 20:29
@danking
danking changed the base branch from codex/piecewise-sequential-run-take-consumers to codex/piecewise-sequence-cursor-copy July 20, 2026 20:30
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from 4bb6ce4 to a42849f Compare July 20, 2026 22:04
@danking
danking force-pushed the codex/piecewise-sequence-cursor-copy branch from 9183265 to 182567a Compare July 20, 2026 22:04
@robert3005
robert3005 force-pushed the codex/piecewise-sequence-cursor-copy branch from 87f6283 to 8235e03 Compare July 21, 2026 09:30
Base automatically changed from codex/piecewise-sequence-cursor-copy to develop July 21, 2026 13:24
@robert3005

Copy link
Copy Markdown
Contributor

I think in order to merge them we have to make them smaller, these should really be fast microbenchmarks

danking added 4 commits July 21, 2026 10:58
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
@danking
danking force-pushed the codex/piecewise-sequence-benchmarks branch from a42849f to 9995892 Compare July 21, 2026 15:00
@danking
danking marked this pull request as ready for review July 21, 2026 15:03
Signed-off-by: Daniel King <dan@spiraldb.com>
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Polar Signals Profiling Results

Latest Run

Status Commit Job Attempt Link
🟢 Done c731e4f 1 Explore Profiling Data
Previous Runs (1)
Status Commit Job Attempt Link
🟢 Done 9995892 1 Explore Profiling Data

Powered by Polar Signals Cloud

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Benchmarks: Vortex queries 📖

Verdict: No clear signal (medium confidence)
Attributed Vortex impact: +8.8%
Engines: DataFusion No clear signal (+7.2%, environment too noisy confidence) · DuckDB Likely regression (+10.4%, medium confidence)
Vortex (geomean): 1.174x ❌
Parquet (geomean): 1.125x ❌
Shifts: Parquet (control) +12.5% · Median polish +18.3%

How to read Verdict and Engines
  • Verdict: Overall PR-level signal after subtracting baseline drift estimated from Parquet control rows. It can be Likely improvement, Likely regression, or No clear signal.
  • Engines: Per-engine attribution. DataFusion is compared against DataFusion/Parquet controls; DuckDB is compared against DuckDB/Parquet controls. This answers whether each engine improved or regressed independently.
  • Confidence: Based on directional consistency, share of rows above the noise floor, and control-run noise.

datafusion / vortex-file-compressed (1.272x ❌, 0↑ 2↓)
name PR c731e4f (ns) base ae9ecec (ns) ratio (PR/base)
vortex_q00/datafusion:vortex-file-compressed 🚨 11716525 9244952 1.27
vortex_q01/datafusion:vortex-file-compressed 🚨 7752580 6075932 1.28
datafusion / parquet (1.186x ❌, 0↑ 2↓)
name PR c731e4f (ns) base ae9ecec (ns) ratio (PR/base)
vortex_q00/datafusion:parquet 🚨 23121989 20820621 1.11
vortex_q01/datafusion:parquet 🚨 5925270 4679197 1.27
duckdb / vortex-file-compressed (1.179x ❌, 0↑ 2↓)
name PR c731e4f (ns) base ae9ecec (ns) ratio (PR/base)
vortex_q00/duckdb:vortex-file-compressed 🚨 11781191 10294945 1.14
vortex_q01/duckdb:vortex-file-compressed 🚨 7503734 6173707 1.22
duckdb / parquet (1.068x ➖, 0↑ 0↓)
name PR c731e4f (ns) base ae9ecec (ns) ratio (PR/base)
vortex_q00/duckdb:parquet 25560487 23450715 1.09
vortex_q01/duckdb:parquet 9926883 9489168 1.05

No file size changes detected.

@danking

danking commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@robert3005 each one is <=500us now but I could bring them down further if you like.

@robert3005

Copy link
Copy Markdown
Contributor

we generally held the bar at 1ms so this is good enough

@robert3005
robert3005 merged commit 62af4a1 into develop Jul 21, 2026
77 checks passed
@robert3005
robert3005 deleted the codex/piecewise-sequence-benchmarks branch July 21, 2026 15:42
sgrebnov added a commit to spiceai/vortex that referenced this pull request Jul 21, 2026
…nnel

The raw `oneshot` crate has a receiver-waker drop bug (vortex-data#6221/vortex-data#8830 class)
that can strand a completed task's wake inside the
buffer_unordered(handle.spawn(..)) scan composition, presenting as the
never-ready cold-tier freeze (POLLED-THEN-PENDING scan, spawned==completed,
backlog>0). Swap Handle::spawn/spawn_io/spawn_cpu/spawn_blocking to
tokio::sync::oneshot, whose receiver waker is robust. Raw `oneshot` crate
stays for other call sites (single.rs/tokio.rs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants