Skip to content

Avoid materializing constant structs for select - #9718

Open
danking wants to merge 1 commit into
developfrom
dk/select-constant-struct
Open

Avoid materializing constant structs for select#9718
danking wants to merge 1 commit into
developfrom
dk/select-constant-struct

Conversation

@danking

@danking danking commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a constant-struct fast path in Select::execute before forcing the child to StructArray
  • project the single struct scalar and wrap it back as a ConstantArray for the original row count
  • add a regression test for selecting fields from a wide, million-row constant struct while keeping the result constant-encoded

Tests

  • cargo +nightly fmt --all
  • cargo test -p vortex-array execute_constant_struct_stays_constant
  • cargo test -p vortex-array select
  • cargo clippy --all-targets --all-features

Signed-off-by: Daniel King <dan@spiraldb.com>
@danking danking added the changelog/performance A performance improvement label Sep 1, 2026
@danking
danking requested review from gatesn and joseph-isaacs and removed request for gatesn September 1, 2026 17:30
@codspeed-hq

codspeed-hq Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will regress 2 benchmarks

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 15 improved benchmarks
❌ 2 regressed benchmarks
✅ 2073 untouched benchmarks
⏩ 206 skipped benchmarks1
🗄️ 4 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime arrow_checked_add_u32_neon[16384] 12.4 µs 20.3 µs -39.19%
WallTime mul_u32_nonnull_avx512 5.7 µs 6.4 µs -10.71%
WallTime add_shapes_neon[(128, PerRowPerRow)] 3.7 µs 1.9 µs +95.48%
WallTime subtract_shapes_neon[(128, PerRowPerRow)] 2.9 µs 1.8 µs +55.44%
WallTime multiply_shapes_neon[(128, PerRowPerRow)] 2.9 µs 1.9 µs +54.79%
Simulation cached_indices_i32[0.01] 51.6 µs 37.7 µs +36.77%
WallTime arrow_checked_add_u32_avx512[16384] 21.3 µs 17.6 µs +20.57%
WallTime arrow_checked_add_u32_avx2[16384] 21.3 µs 17.7 µs +20.35%
WallTime add_u32_nonnull_neon 7.9 µs 6.6 µs +20.35%
WallTime add_shapes_neon[(16384, PerRowPerRow)] 11.3 µs 9.8 µs +15.21%
WallTime add_i32_nonnull_neon 9 µs 7.8 µs +14.99%
WallTime compare_int_nullable_neon 5.6 µs 4.9 µs +14.92%
WallTime add_i64_nonnull_neon 11.3 µs 9.8 µs +14.72%
Simulation cold_misaligned[(16, 64)] 392.4 µs 346.6 µs +13.21%
WallTime add_i64_nullable_neon 12.8 µs 11.5 µs +11.36%
WallTime compare_int_constant_neon 4.4 µs 4 µs +10.73%
WallTime mul_i32_nonnull_avx512 8 µs 7.2 µs +10.55%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing dk/select-constant-struct (515f9a5) with develop (a67cd1b)3

Open in CodSpeed

Footnotes

  1. 206 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.

  2. 4 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them.

  3. No successful run was found on develop (41da992) during the generation of this report, so a67cd1b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@danking
danking enabled auto-merge (squash) September 1, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant