Skip to content

execute_until returns Match rather than ArrayRef#8601

Draft
mhk197 wants to merge 1 commit into
developfrom
mk/execute-until-match
Draft

execute_until returns Match rather than ArrayRef#8601
mhk197 wants to merge 1 commit into
developfrom
mk/execute-until-match

Conversation

@mhk197

@mhk197 mhk197 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Reworks ArrayRef::execute_until so it returns the matcher's view directly instead of discarding the match result and handing back an ArrayRef that callers must re-downcast.

pub fn execute_until<'a, M: Matcher>(
    &'a mut self,
    ctx: &mut ExecutionCtx,
) -> VortexResult<M::Match<'a>>
  • Takes &mut self: it mem::replaces self with a cheap alloc-free Array::<Null>::new(0) placeholder, runs the existing loop (now a private execute_until_done(self, ctx, done)), writes the executed array back into *self, and returns M::try_match(self). The placeholder keeps the loop's in-place Arc::get_mut optimizations intact.
  • Behavioral change: errors if execution converges to a canonical form that M does not match, rather than silently returning that canonical array.
  • Adds OrCanonical<M> (+ OrCanonicalMatch { Matched(M::Match) | Canonical(CanonicalView) }) to restore the old non-failing behavior with a typed fallback, for callers that want it.

Signed-off-by: Matt Katz <mhkatz97@gmail.com>
@mhk197 mhk197 changed the title execute_until returns the matcher view (&mut self) [experimental] execute_until returns the matcher view Jun 25, 2026
@mhk197 mhk197 changed the title [experimental] execute_until returns the matcher view execute_until returns Match rather than ArrayRef Jun 25, 2026
@codspeed-hq

codspeed-hq Bot commented Jun 25, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 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

⚡ 11 improved benchmarks
❌ 12 regressed benchmarks
✅ 1566 untouched benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_canonical_into[(1000, 10)] 16 µs 26.4 µs -39.45%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 169 µs 206.2 µs -18.05%
Simulation chunked_opt_bool_canonical_into[(100, 100)] 140.2 µs 163.9 µs -14.44%
Simulation decode_primitives[f32, (1000, 2)] 17.2 µs 20 µs -14.32%
Simulation decode_primitives[f32, (1000, 4)] 17.2 µs 20 µs -13.93%
Simulation decode_primitives[f32, (1000, 8)] 17.2 µs 19.6 µs -12.29%
Simulation decode_primitives[f32, (1000, 32)] 17.2 µs 19.6 µs -12.25%
Simulation chunked_varbinview_opt_canonical_into[(10, 1000)] 1.7 ms 1.9 ms -11.59%
Simulation chunked_opt_bool_into_canonical[(100, 100)] 188.1 µs 211.3 µs -10.99%
Simulation decode_primitives[i64, (1000, 32)] 20.3 µs 22.5 µs -10.15%
Simulation chunked_opt_bool_canonical_into[(1000, 10)] 29.7 µs 33 µs -10.15%
Simulation eq_i64_constant 288.6 µs 321 µs -10.08%
Simulation varbinview_large 392.9 µs 134 µs ×2.9
Simulation copy_nullable[65536] 1.4 ms 1 ms +31.88%
Simulation bitwise_not_vortex_buffer_mut[128] 244.4 ns 186.1 ns +31.34%
Simulation bitwise_not_vortex_buffer_mut[1024] 304.7 ns 246.4 ns +23.68%
Simulation copy_non_nullable[65536] 1,089.1 µs 909.7 µs +19.72%
Simulation bitwise_not_vortex_buffer_mut[2048] 398.6 ns 340.3 ns +17.14%
Simulation chunked_varbinview_into_canonical[(100, 100)] 306.5 µs 272.5 µs +12.45%
Simulation encode_varbin[(1000, 32)] 165 µs 146.9 µs +12.34%
... ... ... ... ... ...

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

Tip

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


Comparing mk/execute-until-match (bc13cc5) with develop (9567467)

Open in CodSpeed

Footnotes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant