Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Is your feature request related to a problem or challenge?
For unrelated reasons, I reduced the size of Expr from 272 to 112 bytes in this PR:
It turns out this change resulted in a a pretty significant (10-20% faster) improvement in planning time #14366 (comment):
group alamb_make_expr_smaller main
----- ----------------------- ----
physical_plan_clickbench_all 1.00 285.4±4.98ms ? ?/sec 1.14 324.2±6.52ms ? ?/sec
physical_plan_clickbench_q1 1.00 4.6±0.12ms ? ?/sec 1.10 5.0±0.13ms ? ?/sec
physical_plan_clickbench_q10 1.00 5.7±0.14ms ? ?/sec 1.16 6.5±0.42ms ? ?/sec
physical_plan_clickbench_q11 1.00 5.8±0.22ms ? ?/sec 1.13 6.6±0.21ms ? ?/sec
physical_plan_clickbench_q12 1.00 6.0±0.17ms ? ?/sec 1.12 6.7±0.24ms ? ?/sec
physical_plan_clickbench_q13 1.00 5.5±0.11ms ? ?/sec 1.12 6.1±0.17ms ? ?/sec
physical_plan_clickbench_q14 1.00 5.8±0.17ms ? ?/sec 1.12 6.5±0.15ms ? ?/sec
physical_plan_clickbench_q15 1.00 5.6±0.14ms ? ?/sec 1.13 6.3±0.18ms ? ?/sec
physical_plan_clickbench_q16 1.00 5.1±0.18ms ? ?/sec 1.09 5.5±0.19ms ? ?/sec
physical_plan_clickbench_q17 1.00 5.0±0.13ms ? ?/sec 1.14 5.8±0.15ms ? ?/sec
physical_plan_clickbench_q18 1.00 4.9±0.13ms ? ?/sec 1.12 5.4±0.15ms ? ?/sec
...
Describe the solution you'd like
I would like to make a new PR that reduces the size of Expr
Describe alternatives you've considered
I suggest
- Change
Expr::WindowFunction(WindowFunction) -->Expr::WindowFunction(Box<WindowFunction>)as described on Reduce size ofExprstruct #14366 - Add a regression test for
Exprsize to ensure we don't get a regression again
Additional context
I recommend:
- Updating the Expr::WindowFunction definition
- Letting the compiler guide you to code that needs to be updated and follow the pattern from Reduce size of
Exprstruct #14366 - Copy the tests from Reduce size of
Exprstruct #14366
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Activity
alamb commentedon May 27, 2025
I think this is a good first issue because
hendrikmakait commentedon May 27, 2025
take
alamb commentedon May 27, 2025
Thanks @hendrikmakait !
Omega359 commentedon May 27, 2025
I am surprised by the magnitude of the performance uptick by essentially moving something from the stack to the heap.
alamb commentedon May 27, 2025
My theory is that the performance difference is not the move to the heap but the fact that then all the places that make
Exprs and copy them, etc have less work to do (as the Expr struct is half the size)Omega359 commentedon May 27, 2025
🤔