Skip to content

Merge stat lowering and row count rewriting into single pass over expressions - #9411

Draft
robert3005 wants to merge 4 commits into
developfrom
rk/lessrewrites
Draft

Merge stat lowering and row count rewriting into single pass over expressions#9411
robert3005 wants to merge 4 commits into
developfrom
rk/lessrewrites

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

Instead of traversing expressions multiple times we do the lowering and row
count substitution at the same time. We also attempt removing duplicate
conditions from and/or predicates on the way up from stat rewriting.

Duplicate reduction is naive and only handles pairs of duplicates and not cases
where duplicates are one chain removed.

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

codspeed-hq Bot commented Aug 14, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 31.13%

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

⚡ 1 improved benchmark
✅ 1999 untouched benchmarks
⏩ 89 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation cast_i32_to_u32[65536] 2.8 ms 2.1 ms +31.13%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing rk/lessrewrites (c960813) with develop (b363fb7)

Open in CodSpeed

Footnotes

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

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 marked this pull request as draft August 14, 2026 16:08
@robert3005

Copy link
Copy Markdown
Contributor Author

double get_item slows down small prunes... need to figure out another option

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