Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Dec 24, 2025

Which issue does this PR close?

Rationale for this change

I am testing where we currently are with performance

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@alamb
Copy link
Contributor Author

alamb commented Dec 24, 2025

run benchmarks

@github-actions github-actions bot added the common Related to common crate label Dec 24, 2025
@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing alamb/enable_pushdown (36eae88) to 67b526a diff using: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and alamb_enable_pushdown
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Query        ┃        HEAD ┃ alamb_enable_pushdown ┃         Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ QQuery 0     │  2685.93 ms │            2651.31 ms │      no change │
│ QQuery 1     │  1073.38 ms │            1053.67 ms │      no change │
│ QQuery 2     │  2088.87 ms │            2076.62 ms │      no change │
│ QQuery 3     │  1135.31 ms │            1169.33 ms │      no change │
│ QQuery 4     │  2311.12 ms │            2333.31 ms │      no change │
│ QQuery 5     │ 28540.84 ms │           29180.44 ms │      no change │
│ QQuery 6     │  4022.77 ms │             231.17 ms │ +17.40x faster │
│ QQuery 7     │  3930.66 ms │            4171.90 ms │   1.06x slower │
└──────────────┴─────────────┴───────────────────────┴────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                    ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                    │ 45788.88ms │
│ Total Time (alamb_enable_pushdown)   │ 42867.76ms │
│ Average Time (HEAD)                  │  5723.61ms │
│ Average Time (alamb_enable_pushdown) │  5358.47ms │
│ Queries Faster                       │          1 │
│ Queries Slower                       │          1 │
│ Queries with No Change               │          6 │
│ Queries with Failure                 │          0 │
└──────────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Query        ┃        HEAD ┃ alamb_enable_pushdown ┃         Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ QQuery 0     │     2.37 ms │               2.13 ms │  +1.12x faster │
│ QQuery 1     │    50.16 ms │              52.79 ms │   1.05x slower │
│ QQuery 2     │   134.81 ms │             131.30 ms │      no change │
│ QQuery 3     │   154.45 ms │             154.20 ms │      no change │
│ QQuery 4     │  1137.52 ms │            1117.24 ms │      no change │
│ QQuery 5     │  1511.93 ms │            1476.79 ms │      no change │
│ QQuery 6     │     2.04 ms │               2.02 ms │      no change │
│ QQuery 7     │    59.58 ms │              68.59 ms │   1.15x slower │
│ QQuery 8     │  1474.01 ms │            1456.40 ms │      no change │
│ QQuery 9     │  1854.79 ms │            1834.23 ms │      no change │
│ QQuery 10    │   353.18 ms │             492.42 ms │   1.39x slower │
│ QQuery 11    │   402.12 ms │             525.34 ms │   1.31x slower │
│ QQuery 12    │  1356.90 ms │            1555.24 ms │   1.15x slower │
│ QQuery 13    │  2021.01 ms │            2244.56 ms │   1.11x slower │
│ QQuery 14    │  1244.62 ms │            1454.12 ms │   1.17x slower │
│ QQuery 15    │  1274.32 ms │            1277.69 ms │      no change │
│ QQuery 16    │  2636.20 ms │            2571.86 ms │      no change │
│ QQuery 17    │  2601.62 ms │            2559.34 ms │      no change │
│ QQuery 18    │  5918.57 ms │            4875.16 ms │  +1.21x faster │
│ QQuery 19    │   130.29 ms │             141.55 ms │   1.09x slower │
│ QQuery 20    │  1929.33 ms │            1857.46 ms │      no change │
│ QQuery 21    │  2200.83 ms │            2330.91 ms │   1.06x slower │
│ QQuery 22    │  3857.11 ms │            3729.31 ms │      no change │
│ QQuery 23    │ 20156.62 ms │            1283.72 ms │ +15.70x faster │
│ QQuery 24    │   221.23 ms │             283.74 ms │   1.28x slower │
│ QQuery 25    │   474.00 ms │             628.50 ms │   1.33x slower │
│ QQuery 26    │   216.46 ms │             340.81 ms │   1.57x slower │
│ QQuery 27    │  2762.90 ms │            2961.52 ms │   1.07x slower │
│ QQuery 28    │ 23671.71 ms │           23963.73 ms │      no change │
│ QQuery 29    │   970.01 ms │             952.03 ms │      no change │
│ QQuery 30    │  1327.99 ms │            1342.13 ms │      no change │
│ QQuery 31    │  1345.31 ms │            1348.15 ms │      no change │
│ QQuery 32    │  5652.98 ms │            4588.56 ms │  +1.23x faster │
│ QQuery 33    │  6275.28 ms │            5666.71 ms │  +1.11x faster │
│ QQuery 34    │  6526.66 ms │            5968.31 ms │  +1.09x faster │
│ QQuery 35    │  1983.97 ms │            1908.53 ms │      no change │
│ QQuery 36    │    66.42 ms │              15.94 ms │  +4.17x faster │
│ QQuery 37    │    45.91 ms │              16.16 ms │  +2.84x faster │
│ QQuery 38    │    65.21 ms │              15.26 ms │  +4.27x faster │
│ QQuery 39    │   105.50 ms │              14.18 ms │  +7.44x faster │
│ QQuery 40    │    27.96 ms │              16.61 ms │  +1.68x faster │
│ QQuery 41    │    22.42 ms │              14.93 ms │  +1.50x faster │
│ QQuery 42    │    19.97 ms │              14.33 ms │  +1.39x faster │
└──────────────┴─────────────┴───────────────────────┴────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Benchmark Summary                    ┃             ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ Total Time (HEAD)                    │ 104246.25ms │
│ Total Time (alamb_enable_pushdown)   │  83254.49ms │
│ Average Time (HEAD)                  │   2424.33ms │
│ Average Time (alamb_enable_pushdown) │   1936.15ms │
│ Queries Faster                       │          13 │
│ Queries Slower                       │          13 │
│ Queries with No Change               │          17 │
│ Queries with Failure                 │           0 │
└──────────────────────────────────────┴─────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃      HEAD ┃ alamb_enable_pushdown ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │ 115.22 ms │             114.68 ms │     no change │
│ QQuery 2     │  29.72 ms │              29.81 ms │     no change │
│ QQuery 3     │  39.93 ms │              38.86 ms │     no change │
│ QQuery 4     │  29.27 ms │              29.63 ms │     no change │
│ QQuery 5     │  90.54 ms │              89.69 ms │     no change │
│ QQuery 6     │  19.67 ms │              19.94 ms │     no change │
│ QQuery 7     │ 252.26 ms │             242.01 ms │     no change │
│ QQuery 8     │  38.03 ms │              39.72 ms │     no change │
│ QQuery 9     │ 105.70 ms │             103.01 ms │     no change │
│ QQuery 10    │  63.88 ms │              61.48 ms │     no change │
│ QQuery 11    │  19.33 ms │              18.03 ms │ +1.07x faster │
│ QQuery 12    │  51.68 ms │              53.21 ms │     no change │
│ QQuery 13    │  47.99 ms │              51.36 ms │  1.07x slower │
│ QQuery 14    │  14.31 ms │              14.02 ms │     no change │
│ QQuery 15    │  24.23 ms │              24.83 ms │     no change │
│ QQuery 16    │  24.31 ms │              25.01 ms │     no change │
│ QQuery 17    │ 152.94 ms │             155.39 ms │     no change │
│ QQuery 18    │ 292.03 ms │             310.42 ms │  1.06x slower │
│ QQuery 19    │  37.18 ms │              38.00 ms │     no change │
│ QQuery 20    │  49.54 ms │              51.51 ms │     no change │
│ QQuery 21    │ 333.15 ms │             350.45 ms │  1.05x slower │
│ QQuery 22    │  17.68 ms │              17.40 ms │     no change │
└──────────────┴───────────┴───────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                    ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                    │ 1848.58ms │
│ Total Time (alamb_enable_pushdown)   │ 1878.46ms │
│ Average Time (HEAD)                  │   84.03ms │
│ Average Time (alamb_enable_pushdown) │   85.38ms │
│ Queries Faster                       │         1 │
│ Queries Slower                       │         3 │
│ Queries with No Change               │        18 │
│ Queries with Failure                 │         0 │
└──────────────────────────────────────┴───────────┘

@adriangb
Copy link
Contributor

What a 🎄 🎁 ! I see mostly speedups, vastly outweighing the slowdowns, but there are still slowdowns... any idea what those cases have in common? Any way I can help brainstorm solutions?

@alamb
Copy link
Contributor Author

alamb commented Dec 27, 2025

What a 🎄 🎁 ! I see mostly speedups, vastly outweighing the slowdowns, but there are still slowdowns... any idea what those cases have in common? Any way I can help brainstorm solutions?

Thanks @adriangb -- I am not working full time the next few days but I am hoping to work on this particular item as it is something I desparately want to be done with (and I find it fun!)

I spent some time analyzing where the time is going. I haven't written up my notes yet, but I will do so (probably tomorrow as I have a long train ride).

I found a few places to improve, but nothing that will obviously get back all the time (yet). I'll kep at it

alamb added a commit to apache/arrow-rs that referenced this pull request Dec 27, 2025
# Which issue does this PR close?

- RElated to  apache/datafusion#19477

# Rationale for this change

While profiling apache/datafusion#19477 I
noticed some additional clones we could avoid

<img width="1504" height="927" alt="Screenshot 2025-12-26 at 12 03
00 PM"
src="https://github.com/user-attachments/assets/958f76e2-53d0-4008-b224-d9275984cd1a"
/>

I doubt this will be a huge deal but it does remove some allocations int
he parquet read path

# What changes are included in this PR?

Use `into_data` rather than `to_data`

# Are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->

# Are there any user-facing changes?

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
@alamb
Copy link
Contributor Author

alamb commented Dec 29, 2025

I also wrote up some notes about current status and plan here:

@Dandandan
Copy link
Contributor

run benchmark tpch

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing alamb/enable_pushdown (36eae88) to 67b526a diff using: tpch
Results will be posted here when complete

@Dandandan
Copy link
Contributor

run benchmark tpcds

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and alamb_enable_pushdown
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query        ┃      HEAD ┃ alamb_enable_pushdown ┃       Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 1     │ 190.82 ms │             199.11 ms │    no change │
│ QQuery 2     │  93.77 ms │             128.85 ms │ 1.37x slower │
│ QQuery 3     │ 125.10 ms │             192.31 ms │ 1.54x slower │
│ QQuery 4     │  75.03 ms │             124.79 ms │ 1.66x slower │
│ QQuery 5     │ 165.04 ms │             342.06 ms │ 2.07x slower │
│ QQuery 6     │  66.31 ms │             107.95 ms │ 1.63x slower │
│ QQuery 7     │ 208.69 ms │             250.14 ms │ 1.20x slower │
│ QQuery 8     │ 164.10 ms │             279.78 ms │ 1.70x slower │
│ QQuery 9     │ 222.55 ms │             389.32 ms │ 1.75x slower │
│ QQuery 10    │ 179.97 ms │             267.35 ms │ 1.49x slower │
│ QQuery 11    │  72.19 ms │             102.21 ms │ 1.42x slower │
│ QQuery 12    │ 116.14 ms │             258.92 ms │ 2.23x slower │
│ QQuery 13    │ 213.12 ms │             209.43 ms │    no change │
│ QQuery 14    │  92.02 ms │             102.09 ms │ 1.11x slower │
│ QQuery 15    │ 119.53 ms │             167.51 ms │ 1.40x slower │
│ QQuery 16    │  56.09 ms │              89.96 ms │ 1.60x slower │
│ QQuery 17    │ 263.36 ms │             278.76 ms │ 1.06x slower │
│ QQuery 18    │ 313.29 ms │             660.48 ms │ 2.11x slower │
│ QQuery 19    │ 132.03 ms │             169.52 ms │ 1.28x slower │
│ QQuery 20    │ 124.02 ms │             147.16 ms │ 1.19x slower │
│ QQuery 21    │ 253.64 ms │             308.28 ms │ 1.22x slower │
│ QQuery 22    │  43.38 ms │              65.67 ms │ 1.51x slower │
└──────────────┴───────────┴───────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                    ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                    │ 3290.19ms │
│ Total Time (alamb_enable_pushdown)   │ 4841.65ms │
│ Average Time (HEAD)                  │  149.55ms │
│ Average Time (alamb_enable_pushdown) │  220.07ms │
│ Queries Faster                       │         0 │
│ Queries Slower                       │        20 │
│ Queries with No Change               │         2 │
│ Queries with Failure                 │         0 │
└──────────────────────────────────────┴───────────┘

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing alamb/enable_pushdown (36eae88) to 67b526a diff using: tpcds
Results will be posted here when complete

@alamb-ghbot
Copy link

Benchmark script failed with exit code 1.

Last 10 lines of output:

Click to expand
BRANCH_NAME: HEAD
DATA_DIR: /home/alamb/arrow-datafusion/benchmarks/data
RESULTS_DIR: /home/alamb/arrow-datafusion/benchmarks/results/HEAD
CARGO_COMMAND: cargo run --release
PREFER_HASH_JOIN: true
***************************

Please prepare TPC-DS data first by following instructions:
  ./bench.sh data tpcds

@Dandandan
Copy link
Contributor

--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query        ┃      HEAD ┃ alamb_enable_pushdown ┃       Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 1     │ 190.82 ms │             199.11 ms │    no change │
│ QQuery 2     │  93.77 ms │             128.85 ms │ 1.37x slower │
│ QQuery 3     │ 125.10 ms │             192.31 ms │ 1.54x slower │
│ QQuery 4     │  75.03 ms │             124.79 ms │ 1.66x slower │
│ QQuery 5     │ 165.04 ms │             342.06 ms │ 2.07x slower │
│ QQuery 6     │  66.31 ms │             107.95 ms │ 1.63x slower │
│ QQuery 7     │ 208.69 ms │             250.14 ms │ 1.20x slower │
│ QQuery 8     │ 164.10 ms │             279.78 ms │ 1.70x slower │
│ QQuery 9     │ 222.55 ms │             389.32 ms │ 1.75x slower │
│ QQuery 10    │ 179.97 ms │             267.35 ms │ 1.49x slower │
│ QQuery 11    │  72.19 ms │             102.21 ms │ 1.42x slower │
│ QQuery 12    │ 116.14 ms │             258.92 ms │ 2.23x slower │
│ QQuery 13    │ 213.12 ms │             209.43 ms │    no change │
│ QQuery 14    │  92.02 ms │             102.09 ms │ 1.11x slower │
│ QQuery 15    │ 119.53 ms │             167.51 ms │ 1.40x slower │
│ QQuery 16    │  56.09 ms │              89.96 ms │ 1.60x slower │
│ QQuery 17    │ 263.36 ms │             278.76 ms │ 1.06x slower │
│ QQuery 18    │ 313.29 ms │             660.48 ms │ 2.11x slower │
│ QQuery 19    │ 132.03 ms │             169.52 ms │ 1.28x slower │
│ QQuery 20    │ 124.02 ms │             147.16 ms │ 1.19x slower │
│ QQuery 21    │ 253.64 ms │             308.28 ms │ 1.22x slower │
│ QQuery 22    │  43.38 ms │              65.67 ms │ 1.51x slower │
└──────────────┴───────────┴───────────────────────┴──────────────┘

This doesn't look great....

@Dandandan
Copy link
Contributor

run benchmark tpch

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing alamb/enable_pushdown (36eae88) to 67b526a diff using: tpch
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and alamb_enable_pushdown
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃      HEAD ┃ alamb_enable_pushdown ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │ 192.60 ms │             197.88 ms │     no change │
│ QQuery 2     │  92.74 ms │             129.40 ms │  1.40x slower │
│ QQuery 3     │ 122.64 ms │             198.28 ms │  1.62x slower │
│ QQuery 4     │  74.81 ms │             132.29 ms │  1.77x slower │
│ QQuery 5     │ 172.26 ms │             342.66 ms │  1.99x slower │
│ QQuery 6     │  66.49 ms │             106.20 ms │  1.60x slower │
│ QQuery 7     │ 214.54 ms │             258.79 ms │  1.21x slower │
│ QQuery 8     │ 159.64 ms │             268.68 ms │  1.68x slower │
│ QQuery 9     │ 222.34 ms │             395.58 ms │  1.78x slower │
│ QQuery 10    │ 186.05 ms │             272.04 ms │  1.46x slower │
│ QQuery 11    │  74.56 ms │             100.83 ms │  1.35x slower │
│ QQuery 12    │ 116.72 ms │             250.88 ms │  2.15x slower │
│ QQuery 13    │ 222.65 ms │             203.76 ms │ +1.09x faster │
│ QQuery 14    │  92.91 ms │             100.57 ms │  1.08x slower │
│ QQuery 15    │ 118.71 ms │             170.82 ms │  1.44x slower │
│ QQuery 16    │  54.74 ms │              86.85 ms │  1.59x slower │
│ QQuery 17    │ 267.10 ms │             283.58 ms │  1.06x slower │
│ QQuery 18    │ 314.15 ms │             658.08 ms │  2.09x slower │
│ QQuery 19    │ 134.45 ms │             169.76 ms │  1.26x slower │
│ QQuery 20    │ 126.26 ms │             145.27 ms │  1.15x slower │
│ QQuery 21    │ 259.83 ms │             310.24 ms │  1.19x slower │
│ QQuery 22    │  42.69 ms │              65.44 ms │  1.53x slower │
└──────────────┴───────────┴───────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                    ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                    │ 3328.90ms │
│ Total Time (alamb_enable_pushdown)   │ 4847.86ms │
│ Average Time (HEAD)                  │  151.31ms │
│ Average Time (alamb_enable_pushdown) │  220.36ms │
│ Queries Faster                       │         1 │
│ Queries Slower                       │        20 │
│ Queries with No Change               │         1 │
│ Queries with Failure                 │         0 │
└──────────────────────────────────────┴───────────┘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants