Skip to content

Implement BetweenReduceRule for ConstantArray#6695

Merged
robert3005 merged 2 commits intodevelopfrom
rk/between
Feb 26, 2026
Merged

Implement BetweenReduceRule for ConstantArray#6695
robert3005 merged 2 commits intodevelopfrom
rk/between

Conversation

@robert3005
Copy link
Contributor

This seems to be missing after migration and it's obviously valuable. Avoids
having to canonicalise result of between on constant array.

Signed-off-by: Robert Kruszewski github@robertk.io

Signed-off-by: Robert Kruszewski <github@robertk.io>
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 26, 2026

Merging this PR will improve performance by 14.47%

⚡ 3 improved benchmarks
✅ 951 untouched benchmarks
⏩ 1466 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation take_map[(0.1, 1.0)] 4 ms 3.5 ms +14.47%
Simulation map_each[BufferMut<i32>, 128] 858.1 ns 770.6 ns +11.36%
Simulation bitwise_not_vortex_buffer_mut[128] 501.1 ns 442.8 ns +13.17%

Comparing rk/between (f14f004) with develop (065f214)

Open in CodSpeed

Footnotes

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

use crate::scalar_fn::fns::between::BetweenOptions;
use crate::scalar_fn::fns::between::BetweenReduce;

impl BetweenReduce for ConstantVTable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought recently there was a change/going to be a change where ConstantArray would save the scalar into a buffer. so wouldn't this break the contract of reduce rules where they don't read buffers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constants will need some more special handling, for a lot of optimisations we will need the value in both cpu and gpu so we can't JUST store it in the buffer

@robert3005 robert3005 added the changelog/performance A performance improvement label Feb 26, 2026
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 merged commit 3f31a66 into develop Feb 26, 2026
52 checks passed
@robert3005 robert3005 deleted the rk/between branch February 26, 2026 19:35
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.

2 participants