execute_until returns Match rather than ArrayRef#8601
Conversation
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
execute_until returns the matcher view
execute_until returns the matcher view execute_until returns Match rather than ArrayRef
Merging this PR will not alter performance
|
| 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)
Footnotes
-
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. ↩
Reworks
ArrayRef::execute_untilso it returns the matcher's view directly instead of discarding the match result and handing back anArrayRefthat callers must re-downcast.&mut self: itmem::replacesselfwith a cheap alloc-freeArray::<Null>::new(0)placeholder, runs the existing loop (now a privateexecute_until_done(self, ctx, done)), writes the executed array back into*self, and returnsM::try_match(self). The placeholder keeps the loop's in-placeArc::get_mutoptimizations intact.Mdoes not match, rather than silently returning that canonical array.OrCanonical<M>(+OrCanonicalMatch { Matched(M::Match) | Canonical(CanonicalView) }) to restore the old non-failing behavior with a typed fallback, for callers that want it.