Skip to content

Reduce size of Expr struct #16207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 2, 2025
Merged

Conversation

hendrikmakait
Copy link
Contributor

Which issue does this PR close?

What changes are included in this PR?

  • Add a test for the size of Expr
  • Change Expr::WindowFunction(WindowFunction) --> Expr::WindowFunction(Box<WindowFunction>) -- which drops the size of Expr from 272 to 144 bytes

Are these changes tested?

  • Functionally by CI
  • Benchmarking is still to be done

Are there any user-facing changes?

No

@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions optimizer Optimizer rules core Core DataFusion crate substrait Changes to the substrait crate proto Related to proto crate functions Changes to functions implementation labels May 29, 2025
@@ -330,7 +331,7 @@ pub enum Expr {
/// [`ExprFunctionExt`]: crate::expr_fn::ExprFunctionExt
AggregateFunction(AggregateFunction),
/// Call a window function with a set of arguments.
WindowFunction(WindowFunction),
WindowFunction(Box<WindowFunction>),
Copy link
Contributor

@Dandandan Dandandan May 29, 2025

Choose a reason for hiding this comment

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

I wonder, what is now 144 bytes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question! I'm fairly new to Rust; what's a good way to analyze the enum variant sizes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like Alias might be the culprit here (with some padding):

size_of::<Alias>() is 136, followed by size_of::<(DataType, Column)>() (alias OuterReferenceColumn) with 128.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe as a follow on experiment we can try to box Alias and OuterReferenceColumn too -- but I recommend not in this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree - although it seems the size of the changes will be lower than 272 to 144 (I hoped maybe there would be a single one to reduce it from 144 -> 80).
Thanks for checking!

Copy link
Contributor

Choose a reason for hiding this comment

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

Turns out I was doing something else and got the size down to 128:

Hopefully this will merge in a bit

@github-actions github-actions bot added the datasource Changes to the datasource crate label May 29, 2025
@hendrikmakait hendrikmakait marked this pull request as ready for review May 29, 2025 15:56
@alamb
Copy link
Contributor

alamb commented May 30, 2025

🤖 ./gh_compare_branch_bench.sh Benchmark Script Running
Linux aal-dev 6.11.0-1013-gcp #13~24.04.1-Ubuntu SMP Wed Apr 2 16:34:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing reduce-expr-struct-size (3ad082c) to 2c2f225 diff
BENCH_NAME=sql_planner
BENCH_COMMAND=cargo bench --bench sql_planner
BENCH_FILTER=
BENCH_BRANCH_NAME=reduce-expr-struct-size
Results will be posted here when complete

@alamb
Copy link
Contributor

alamb commented May 30, 2025

I kicked off some benchmarks for this PR -- thank you @hendrikmakait 🙏

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you so much @hendrikmakait and @Dandandan

Assuming the benchmarks look good I think we should merge this PR.

Here is hoping for some improved performance: 🙏

@alamb
Copy link
Contributor

alamb commented May 30, 2025

🤖: Benchmark completed

Details

group                                         main                                   reduce-expr-struct-size
-----                                         ----                                   -----------------------
logical_aggregate_with_join                   1.03    749.1±2.47µs        ? ?/sec    1.00    728.8±3.55µs        ? ?/sec
logical_select_all_from_1000                  1.00    123.6±0.31ms        ? ?/sec    1.00    123.5±0.23ms        ? ?/sec
logical_select_one_from_700                   1.01    422.4±1.88µs        ? ?/sec    1.00    419.2±1.88µs        ? ?/sec
logical_trivial_join_high_numbered_columns    1.02    385.4±5.88µs        ? ?/sec    1.00    378.7±6.61µs        ? ?/sec
logical_trivial_join_low_numbered_columns     1.01    370.3±1.93µs        ? ?/sec    1.00    365.2±3.99µs        ? ?/sec
physical_intersection                         1.04   869.0±11.57µs        ? ?/sec    1.00    831.8±5.20µs        ? ?/sec
physical_join_consider_sort                   1.03   1402.3±6.23µs        ? ?/sec    1.00   1355.0±5.68µs        ? ?/sec
physical_join_distinct                        1.01    359.1±2.18µs        ? ?/sec    1.00    354.8±1.38µs        ? ?/sec
physical_many_self_joins                      1.02     10.4±0.05ms        ? ?/sec    1.00     10.2±0.05ms        ? ?/sec
physical_plan_clickbench_all                  1.03    147.7±1.46ms        ? ?/sec    1.00    143.3±1.44ms        ? ?/sec
physical_plan_clickbench_q1                   1.02  1730.9±17.67µs        ? ?/sec    1.00  1691.0±22.98µs        ? ?/sec
physical_plan_clickbench_q10                  1.05      2.5±0.02ms        ? ?/sec    1.00      2.4±0.04ms        ? ?/sec
physical_plan_clickbench_q11                  1.02      2.6±0.03ms        ? ?/sec    1.00      2.5±0.03ms        ? ?/sec
physical_plan_clickbench_q12                  1.03      2.7±0.03ms        ? ?/sec    1.00      2.6±0.05ms        ? ?/sec
physical_plan_clickbench_q13                  1.04      2.4±0.03ms        ? ?/sec    1.00      2.3±0.03ms        ? ?/sec
physical_plan_clickbench_q14                  1.02      2.6±0.02ms        ? ?/sec    1.00      2.5±0.04ms        ? ?/sec
physical_plan_clickbench_q15                  1.05      2.5±0.03ms        ? ?/sec    1.00      2.4±0.02ms        ? ?/sec
physical_plan_clickbench_q16                  1.03      2.3±0.03ms        ? ?/sec    1.00      2.3±0.02ms        ? ?/sec
physical_plan_clickbench_q17                  1.03      2.4±0.02ms        ? ?/sec    1.00      2.4±0.02ms        ? ?/sec
physical_plan_clickbench_q18                  1.02  1998.0±14.44µs        ? ?/sec    1.00  1961.3±21.79µs        ? ?/sec
physical_plan_clickbench_q19                  1.05      2.9±0.05ms        ? ?/sec    1.00      2.8±0.04ms        ? ?/sec
physical_plan_clickbench_q2                   1.02  1953.9±22.03µs        ? ?/sec    1.00  1910.3±21.29µs        ? ?/sec
physical_plan_clickbench_q20                  1.02  1690.4±24.95µs        ? ?/sec    1.00  1657.7±19.62µs        ? ?/sec
physical_plan_clickbench_q21                  1.04      2.0±0.06ms        ? ?/sec    1.00  1955.6±24.11µs        ? ?/sec
physical_plan_clickbench_q22                  1.04      2.6±0.04ms        ? ?/sec    1.00      2.5±0.03ms        ? ?/sec
physical_plan_clickbench_q23                  1.07      3.0±0.05ms        ? ?/sec    1.00      2.8±0.03ms        ? ?/sec
physical_plan_clickbench_q24                  1.04      4.7±0.08ms        ? ?/sec    1.00      4.5±0.04ms        ? ?/sec
physical_plan_clickbench_q25                  1.03      2.0±0.02ms        ? ?/sec    1.00  1978.0±26.06µs        ? ?/sec
physical_plan_clickbench_q26                  1.02  1838.4±25.40µs        ? ?/sec    1.00  1801.0±23.81µs        ? ?/sec
physical_plan_clickbench_q27                  1.03      2.1±0.02ms        ? ?/sec    1.00  1996.3±19.56µs        ? ?/sec
physical_plan_clickbench_q28                  1.05      2.9±0.02ms        ? ?/sec    1.00      2.8±0.02ms        ? ?/sec
physical_plan_clickbench_q29                  1.05      3.6±0.04ms        ? ?/sec    1.00      3.5±0.02ms        ? ?/sec
physical_plan_clickbench_q3                   1.03  1943.5±29.11µs        ? ?/sec    1.00  1884.8±20.97µs        ? ?/sec
physical_plan_clickbench_q30                  1.06     15.2±0.16ms        ? ?/sec    1.00     14.3±0.12ms        ? ?/sec
physical_plan_clickbench_q31                  1.04      2.9±0.03ms        ? ?/sec    1.00      2.8±0.03ms        ? ?/sec
physical_plan_clickbench_q32                  1.04      2.9±0.02ms        ? ?/sec    1.00      2.8±0.03ms        ? ?/sec
physical_plan_clickbench_q33                  1.03      2.5±0.02ms        ? ?/sec    1.00      2.4±0.02ms        ? ?/sec
physical_plan_clickbench_q34                  1.02      2.1±0.02ms        ? ?/sec    1.00      2.1±0.03ms        ? ?/sec
physical_plan_clickbench_q35                  1.03      2.2±0.04ms        ? ?/sec    1.00      2.2±0.03ms        ? ?/sec
physical_plan_clickbench_q36                  1.03      3.0±0.03ms        ? ?/sec    1.00      2.9±0.02ms        ? ?/sec
physical_plan_clickbench_q37                  1.05      3.1±0.02ms        ? ?/sec    1.00      2.9±0.03ms        ? ?/sec
physical_plan_clickbench_q38                  1.05      3.1±0.03ms        ? ?/sec    1.00      2.9±0.02ms        ? ?/sec
physical_plan_clickbench_q39                  1.05      2.8±0.04ms        ? ?/sec    1.00      2.7±0.03ms        ? ?/sec
physical_plan_clickbench_q4                   1.01  1670.9±19.27µs        ? ?/sec    1.00  1650.8±19.41µs        ? ?/sec
physical_plan_clickbench_q40                  1.01      3.4±0.02ms        ? ?/sec    1.00      3.4±0.04ms        ? ?/sec
physical_plan_clickbench_q41                  1.03      3.0±0.03ms        ? ?/sec    1.00      2.9±0.03ms        ? ?/sec
physical_plan_clickbench_q42                  1.04      3.0±0.03ms        ? ?/sec    1.00      2.8±0.03ms        ? ?/sec
physical_plan_clickbench_q43                  1.05      3.1±0.03ms        ? ?/sec    1.00      3.0±0.03ms        ? ?/sec
physical_plan_clickbench_q44                  1.01  1823.1±32.07µs        ? ?/sec    1.00  1802.7±16.83µs        ? ?/sec
physical_plan_clickbench_q45                  1.01  1825.9±17.96µs        ? ?/sec    1.00  1803.9±20.13µs        ? ?/sec
physical_plan_clickbench_q46                  1.03      2.3±0.02ms        ? ?/sec    1.00      2.2±0.02ms        ? ?/sec
physical_plan_clickbench_q47                  1.04      2.9±0.02ms        ? ?/sec    1.00      2.8±0.03ms        ? ?/sec
physical_plan_clickbench_q48                  1.03      3.5±0.04ms        ? ?/sec    1.00      3.4±0.02ms        ? ?/sec
physical_plan_clickbench_q49                  1.04      3.9±0.14ms        ? ?/sec    1.00      3.8±0.03ms        ? ?/sec
physical_plan_clickbench_q5                   1.01  1868.2±22.15µs        ? ?/sec    1.00  1849.7±20.41µs        ? ?/sec
physical_plan_clickbench_q50                  1.06      3.5±0.02ms        ? ?/sec    1.00      3.3±0.05ms        ? ?/sec
physical_plan_clickbench_q51                  1.03      2.4±0.02ms        ? ?/sec    1.00      2.3±0.03ms        ? ?/sec
physical_plan_clickbench_q52                  1.05      3.2±0.01ms        ? ?/sec    1.00      3.1±0.03ms        ? ?/sec
physical_plan_clickbench_q6                   1.03  1881.7±28.43µs        ? ?/sec    1.00  1829.2±23.61µs        ? ?/sec
physical_plan_clickbench_q7                   1.02  1727.3±23.85µs        ? ?/sec    1.00  1699.3±21.56µs        ? ?/sec
physical_plan_clickbench_q8                   1.04      2.4±0.03ms        ? ?/sec    1.00      2.3±0.02ms        ? ?/sec
physical_plan_clickbench_q9                   1.02      2.3±0.02ms        ? ?/sec    1.00      2.2±0.02ms        ? ?/sec
physical_plan_tpcds_all                       1.07   1112.0±7.41ms        ? ?/sec    1.00   1034.9±4.20ms        ? ?/sec
physical_plan_tpch_all                        1.09     65.8±0.26ms        ? ?/sec    1.00     60.6±0.26ms        ? ?/sec
physical_plan_tpch_q1                         1.08      2.3±0.01ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
physical_plan_tpch_q10                        1.06      3.4±0.02ms        ? ?/sec    1.00      3.2±0.01ms        ? ?/sec
physical_plan_tpch_q11                        1.08      3.5±0.01ms        ? ?/sec    1.00      3.2±0.01ms        ? ?/sec
physical_plan_tpch_q12                        1.10  1983.0±12.24µs        ? ?/sec    1.00   1805.7±8.81µs        ? ?/sec
physical_plan_tpch_q13                        1.07   1510.4±8.81µs        ? ?/sec    1.00  1409.0±17.50µs        ? ?/sec
physical_plan_tpch_q14                        1.07      2.0±0.01ms        ? ?/sec    1.00   1886.5±8.65µs        ? ?/sec
physical_plan_tpch_q16                        1.09      2.6±0.02ms        ? ?/sec    1.00      2.4±0.02ms        ? ?/sec
physical_plan_tpch_q17                        1.09      2.6±0.01ms        ? ?/sec    1.00      2.4±0.02ms        ? ?/sec
physical_plan_tpch_q18                        1.08      2.8±0.02ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
physical_plan_tpch_q19                        1.16      4.0±0.02ms        ? ?/sec    1.00      3.5±0.02ms        ? ?/sec
physical_plan_tpch_q2                         1.08      5.7±0.03ms        ? ?/sec    1.00      5.3±0.02ms        ? ?/sec
physical_plan_tpch_q20                        1.09      3.3±0.02ms        ? ?/sec    1.00      3.1±0.02ms        ? ?/sec
physical_plan_tpch_q21                        1.08      4.4±0.02ms        ? ?/sec    1.00      4.1±0.02ms        ? ?/sec
physical_plan_tpch_q22                        1.10      3.0±0.02ms        ? ?/sec    1.00      2.7±0.03ms        ? ?/sec
physical_plan_tpch_q3                         1.07      2.3±0.01ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
physical_plan_tpch_q4                         1.08   1668.9±7.60µs        ? ?/sec    1.00   1549.1±8.07µs        ? ?/sec
physical_plan_tpch_q5                         1.07      3.3±0.02ms        ? ?/sec    1.00      3.1±0.01ms        ? ?/sec
physical_plan_tpch_q6                         1.10    950.0±5.74µs        ? ?/sec    1.00    864.0±7.88µs        ? ?/sec
physical_plan_tpch_q7                         1.08      4.4±0.02ms        ? ?/sec    1.00      4.1±0.02ms        ? ?/sec
physical_plan_tpch_q8                         1.06      5.4±0.04ms        ? ?/sec    1.00      5.1±0.04ms        ? ?/sec
physical_plan_tpch_q9                         1.06      4.2±0.03ms        ? ?/sec    1.00      4.0±0.02ms        ? ?/sec
physical_select_aggregates_from_200           1.04     26.2±0.12ms        ? ?/sec    1.00     25.1±0.11ms        ? ?/sec
physical_select_all_from_1000                 1.00    138.2±0.54ms        ? ?/sec    1.00    137.9±0.23ms        ? ?/sec
physical_select_one_from_700                  1.02   1088.5±5.39µs        ? ?/sec    1.00   1071.2±5.13µs        ? ?/sec
physical_sorted_union_orderby                 1.05     64.3±0.37ms        ? ?/sec    1.00     61.1±0.41ms        ? ?/sec
physical_theta_join_consider_sort             1.03   1773.0±8.54µs        ? ?/sec    1.00  1728.1±12.45µs        ? ?/sec
physical_unnest_to_join                       1.04   1362.4±7.02µs        ? ?/sec    1.00  1304.2±10.69µs        ? ?/sec
with_param_values_many_columns                1.17    167.2±0.96µs        ? ?/sec    1.00    143.1±0.92µs        ? ?/sec

@alamb
Copy link
Contributor

alamb commented May 30, 2025

🤖 ./gh_compare_branch.sh Benchmark Script Running
Linux aal-dev 6.11.0-1013-gcp #13~24.04.1-Ubuntu SMP Wed Apr 2 16:34:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing reduce-expr-struct-size (3ad082c) to 2c2f225 diff
Benchmarks: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@alamb
Copy link
Contributor

alamb commented May 30, 2025

🤖: Benchmark completed

Details

Comparing HEAD and reduce-expr-struct-size
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃       HEAD ┃ reduce-expr-struct-size ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0     │  1942.63ms │               1966.87ms │     no change │
│ QQuery 1     │   717.15ms │                700.88ms │     no change │
│ QQuery 2     │  1467.62ms │               1429.88ms │     no change │
│ QQuery 3     │   695.60ms │                685.65ms │     no change │
│ QQuery 4     │  1462.18ms │               1474.42ms │     no change │
│ QQuery 5     │ 15721.51ms │              15581.23ms │     no change │
│ QQuery 6     │  2062.32ms │               2036.21ms │     no change │
│ QQuery 7     │  2270.27ms │               2083.30ms │ +1.09x faster │
│ QQuery 8     │   836.18ms │                845.40ms │     no change │
└──────────────┴────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 27175.46ms │
│ Total Time (reduce-expr-struct-size)   │ 26803.84ms │
│ Average Time (HEAD)                    │  3019.50ms │
│ Average Time (reduce-expr-struct-size) │  2978.20ms │
│ Queries Faster                         │          1 │
│ Queries Slower                         │          0 │
│ Queries with No Change                 │          8 │
└────────────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃       HEAD ┃ reduce-expr-struct-size ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0     │    15.63ms │                 15.00ms │     no change │
│ QQuery 1     │    33.27ms │                 32.47ms │     no change │
│ QQuery 2     │    82.50ms │                 81.25ms │     no change │
│ QQuery 3     │    94.25ms │                 98.21ms │     no change │
│ QQuery 4     │   587.93ms │                571.78ms │     no change │
│ QQuery 5     │   833.99ms │                847.44ms │     no change │
│ QQuery 6     │    24.18ms │                 23.83ms │     no change │
│ QQuery 7     │    39.01ms │                 38.25ms │     no change │
│ QQuery 8     │   905.00ms │                916.35ms │     no change │
│ QQuery 9     │  1212.46ms │               1222.81ms │     no change │
│ QQuery 10    │   260.41ms │                262.26ms │     no change │
│ QQuery 11    │   292.92ms │                298.17ms │     no change │
│ QQuery 12    │   895.98ms │                925.99ms │     no change │
│ QQuery 13    │  1364.30ms │               1194.60ms │ +1.14x faster │
│ QQuery 14    │   842.70ms │                849.81ms │     no change │
│ QQuery 15    │   823.74ms │                816.12ms │     no change │
│ QQuery 16    │  1750.44ms │               1737.46ms │     no change │
│ QQuery 17    │  1612.09ms │               1618.81ms │     no change │
│ QQuery 18    │  3077.16ms │               3088.23ms │     no change │
│ QQuery 19    │    82.83ms │                 85.59ms │     no change │
│ QQuery 20    │  1191.35ms │               1162.37ms │     no change │
│ QQuery 21    │  1333.85ms │               1333.28ms │     no change │
│ QQuery 22    │  2210.24ms │               2214.84ms │     no change │
│ QQuery 23    │  8055.93ms │               8149.44ms │     no change │
│ QQuery 24    │   475.26ms │                473.62ms │     no change │
│ QQuery 25    │   387.85ms │                392.97ms │     no change │
│ QQuery 26    │   524.75ms │                523.65ms │     no change │
│ QQuery 27    │  1607.14ms │               1627.18ms │     no change │
│ QQuery 28    │ 12685.19ms │              13601.69ms │  1.07x slower │
│ QQuery 29    │   535.98ms │                525.12ms │     no change │
│ QQuery 30    │   789.38ms │                807.62ms │     no change │
│ QQuery 31    │   851.48ms │                851.02ms │     no change │
│ QQuery 32    │  2663.64ms │               2669.92ms │     no change │
│ QQuery 33    │  3352.71ms │               3397.47ms │     no change │
│ QQuery 34    │  3365.36ms │               3385.66ms │     no change │
│ QQuery 35    │  1276.16ms │               1314.40ms │     no change │
│ QQuery 36    │   123.82ms │                126.31ms │     no change │
│ QQuery 37    │    55.73ms │                 55.26ms │     no change │
│ QQuery 38    │   123.74ms │                124.90ms │     no change │
│ QQuery 39    │   195.70ms │                201.46ms │     no change │
│ QQuery 40    │    50.86ms │                 47.14ms │ +1.08x faster │
│ QQuery 41    │    44.64ms │                 44.23ms │     no change │
│ QQuery 42    │    38.32ms │                 39.80ms │     no change │
└──────────────┴────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 56769.88ms │
│ Total Time (reduce-expr-struct-size)   │ 57793.75ms │
│ Average Time (HEAD)                    │  1320.23ms │
│ Average Time (reduce-expr-struct-size) │  1344.04ms │
│ Queries Faster                         │          2 │
│ Queries Slower                         │          1 │
│ Queries with No Change                 │         40 │
└────────────────────────────────────────┴────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query        ┃     HEAD ┃ reduce-expr-struct-size ┃    Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1     │ 120.90ms │                121.08ms │ no change │
│ QQuery 2     │  21.87ms │                 22.50ms │ no change │
│ QQuery 3     │  35.03ms │                 35.26ms │ no change │
│ QQuery 4     │  20.12ms │                 19.95ms │ no change │
│ QQuery 5     │  51.75ms │                 54.01ms │ no change │
│ QQuery 6     │  12.08ms │                 11.97ms │ no change │
│ QQuery 7     │  97.55ms │                 99.31ms │ no change │
│ QQuery 8     │  26.16ms │                 25.59ms │ no change │
│ QQuery 9     │  60.31ms │                 59.04ms │ no change │
│ QQuery 10    │  58.15ms │                 58.05ms │ no change │
│ QQuery 11    │  11.74ms │                 11.24ms │ no change │
│ QQuery 12    │  43.72ms │                 43.96ms │ no change │
│ QQuery 13    │  26.75ms │                 27.78ms │ no change │
│ QQuery 14    │   9.93ms │                  9.88ms │ no change │
│ QQuery 15    │  22.98ms │                 22.41ms │ no change │
│ QQuery 16    │  21.65ms │                 21.42ms │ no change │
│ QQuery 17    │  95.60ms │                 96.20ms │ no change │
│ QQuery 18    │ 219.75ms │                211.23ms │ no change │
│ QQuery 19    │  26.45ms │                 26.81ms │ no change │
│ QQuery 20    │  34.11ms │                 35.50ms │ no change │
│ QQuery 21    │ 159.64ms │                160.13ms │ no change │
│ QQuery 22    │  16.08ms │                 16.02ms │ no change │
└──────────────┴──────────┴─────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 1192.31ms │
│ Total Time (reduce-expr-struct-size)   │ 1189.34ms │
│ Average Time (HEAD)                    │   54.20ms │
│ Average Time (reduce-expr-struct-size) │   54.06ms │
│ Queries Faster                         │         0 │
│ Queries Slower                         │         0 │
│ Queries with No Change                 │        22 │
└────────────────────────────────────────┴───────────┘

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

The planning benchmarks look really good to me. Thanks again @hendrikmakait

@alamb alamb added the api change Changes the API exposed to users of the crate label May 30, 2025
@alamb
Copy link
Contributor

alamb commented May 30, 2025

I'll leave this open for a few days to gather any remaining feedback

@alamb
Copy link
Contributor

alamb commented Jun 1, 2025

I plan to merge this tomorrow so it can be included in DataFusion 48.0.0

@alamb
Copy link
Contributor

alamb commented Jun 2, 2025

🚀 -- thanks again @hendrikmakait

@alamb alamb merged commit 7248259 into apache:main Jun 2, 2025
27 checks passed
@alamb alamb added the performance Make DataFusion faster label Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Changes the API exposed to users of the crate core Core DataFusion crate datasource Changes to the datasource crate functions Changes to functions implementation logical-expr Logical plan and expressions optimizer Optimizer rules performance Make DataFusion faster proto Related to proto crate sql SQL Planner substrait Changes to the substrait crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce size of Expr struct
3 participants