Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jhorstmann
Copy link
Contributor

@jhorstmann jhorstmann commented Jun 29, 2025

Which issue does this PR close?

We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax.

Rationale for this change

The changes in this PR improve parquet writing performance for primitives by up to 45%.

What changes are included in this PR?

There was not a single bottleneck to fix, instead several small improvements contributed to the performance increase:

  • Optimize counting of values and nulls by replacing a loop with code that can be vectorized by the compiler. The number of nulls can also be calculated from the lengths of the array and the number of values to write, instead of being counted separately.
  • Change asserts in BitWriter::put_value to debug_assert since these should never be triggered by users of the code and are not required for soundness.
  • Use slice iteration instead of indexing in flush_bit_packed_run to avoid a bounds check.
  • Separate iteration for def_levels and non_null_indices using specialized iterators. Range iteration is TrustedLen and so avoids multiple capacity checks and BitIndexIterator is more optimized for collecting non-null indices.
  • Cache logical nulls of the array to avoid clones or repeated recomputation. This should avoid a pathological case when writing lists of arrays that need logical nulls.
  • Optimize bloom filter initialization to a single memset and write all blocks as a single slice on little endian targets.

Are these changes tested?

Logic should be covered by existing tests.

Are there any user-facing changes?

No, all changes are to implementation details and do not affect public apis.

@github-actions github-actions bot added parquet Changes to the parquet crate arrow Changes to the arrow crate labels Jun 29, 2025
@jhorstmann jhorstmann force-pushed the parquet-writing-performance branch from 3a807a5 to 11e76a3 Compare June 29, 2025 16:12
@Dandandan
Copy link
Contributor

Is this ready for review @jhorstmann ?

@jhorstmann jhorstmann marked this pull request as ready for review July 2, 2025 12:39
@jhorstmann
Copy link
Contributor Author

@Dandandan I think this should be ready for review. I haven't gotten around to re-run all parquet writing benchmarks yet, maybe @alamb can also do his benchmark magic :)
The issue lists some further ideas for improvements, but those are a bit more complex and could be done in a followup.

@jhorstmann
Copy link
Contributor Author

Benchmark results from a local run with -Ctarget-cpu=native:

write_batch primitive/4096 values primitive
                        time:   [476.56 µs 477.29 µs 478.26 µs]
                        thrpt:  [367.86 MiB/s 368.61 MiB/s 369.18 MiB/s]
                 change:
                        time:   [-28.207% -27.412% -26.910%] (p = 0.00 < 0.05)
                        thrpt:  [+36.817% +37.763% +39.289%]
                        Performance has improved.
write_batch primitive/4096 values primitive with bloom filter
                        time:   [4.6939 ms 4.7261 ms 4.7606 ms]
                        thrpt:  [36.956 MiB/s 37.226 MiB/s 37.482 MiB/s]
                 change:
                        time:   [-2.5791% -1.8121% -1.0755%] (p = 0.00 < 0.05)
                        thrpt:  [+1.0872% +1.8456% +2.6474%]
                        Performance has improved.
write_batch primitive/4096 values primitive non-null
                        time:   [387.15 µs 389.86 µs 395.46 µs]
                        thrpt:  [436.24 MiB/s 442.50 MiB/s 445.61 MiB/s]
                 change:
                        time:   [-13.168% -12.894% -12.420%] (p = 0.00 < 0.05)
                        thrpt:  [+14.182% +14.802% +15.165%]
                        Performance has improved.
write_batch primitive/4096 values primitive non-null with bloom filter
                        time:   [4.6790 ms 4.6942 ms 4.7115 ms]
                        thrpt:  [36.616 MiB/s 36.751 MiB/s 36.870 MiB/s]
                 change:
                        time:   [-2.2927% -1.8226% -1.3822%] (p = 0.00 < 0.05)
                        thrpt:  [+1.4015% +1.8564% +2.3465%]
                        Performance has improved.
write_batch primitive/4096 values bool
                        time:   [34.476 µs 34.581 µs 34.717 µs]
                        thrpt:  [30.547 MiB/s 30.667 MiB/s 30.761 MiB/s]
                 change:
                        time:   [-41.518% -40.820% -40.108%] (p = 0.00 < 0.05)
                        thrpt:  [+66.966% +68.977% +70.994%]
                        Performance has improved.
write_batch primitive/4096 values bool non-null
                        time:   [20.286 µs 20.328 µs 20.380 µs]
                        thrpt:  [28.077 MiB/s 28.148 MiB/s 28.207 MiB/s]
                 change:
                        time:   [-28.555% -28.463% -28.362%] (p = 0.00 < 0.05)
                        thrpt:  [+39.591% +39.788% +39.967%]
                        Performance has improved.
write_batch primitive/4096 values string
                        time:   [512.18 µs 512.45 µs 512.75 µs]
                        thrpt:  [3.9009 GiB/s 3.9032 GiB/s 3.9053 GiB/s]
                 change:
                        time:   [-5.8849% -5.7654% -5.6374%] (p = 0.00 < 0.05)
                        thrpt:  [+5.9742% +6.1181% +6.2528%]
                        Performance has improved.
write_batch primitive/4096 values string with bloom filter
                        time:   [990.06 µs 991.34 µs 992.86 µs]
                        thrpt:  [2.0146 GiB/s 2.0177 GiB/s 2.0203 GiB/s]
                 change:
                        time:   [-4.0814% -3.2002% -2.4531%] (p = 0.00 < 0.05)
                        thrpt:  [+2.5148% +3.3060% +4.2551%]
                        Performance has improved.
write_batch primitive/4096 values string #2
                        time:   [225.11 µs 225.57 µs 226.14 µs]
                        thrpt:  [558.08 MiB/s 559.49 MiB/s 560.65 MiB/s]
                 change:
                        time:   [-13.134% -12.724% -12.312%] (p = 0.00 < 0.05)
                        thrpt:  [+14.041% +14.580% +15.119%]
                        Performance has improved.
write_batch primitive/4096 values string with bloom filter #2
                        time:   [542.18 µs 542.61 µs 543.16 µs]
                        thrpt:  [232.35 MiB/s 232.59 MiB/s 232.77 MiB/s]
                 change:
                        time:   [-4.4430% -4.1789% -3.9231%] (p = 0.00 < 0.05)
                        thrpt:  [+4.0833% +4.3612% +4.6496%]
                        Performance has improved.
write_batch primitive/4096 values string dictionary
                        time:   [263.02 µs 263.21 µs 263.44 µs]
                        thrpt:  [3.8264 GiB/s 3.8298 GiB/s 3.8325 GiB/s]
                 change:
                        time:   [-12.989% -11.939% -11.008%] (p = 0.00 < 0.05)
                        thrpt:  [+12.370% +13.558% +14.928%]
                        Performance has improved.
write_batch primitive/4096 values string dictionary with bloom filter
                        time:   [502.98 µs 503.29 µs 503.64 µs]
                        thrpt:  [2.0015 GiB/s 2.0029 GiB/s 2.0041 GiB/s]
                 change:
                        time:   [-5.9241% -5.7646% -5.6083%] (p = 0.00 < 0.05)
                        thrpt:  [+5.9415% +6.1172% +6.2971%]
                        Performance has improved.
write_batch primitive/4096 values string non-null
                        time:   [689.09 µs 690.48 µs 692.29 µs]
                        thrpt:  [2.8879 GiB/s 2.8954 GiB/s 2.9013 GiB/s]
                 change:
                        time:   [-1.6423% -1.1567% -0.5306%] (p = 0.00 < 0.05)
                        thrpt:  [+0.5335% +1.1702% +1.6698%]
                        Change within noise threshold.
write_batch primitive/4096 values string non-null with bloom filter
                        time:   [1.2297 ms 1.2313 ms 1.2334 ms]
                        thrpt:  [1.6209 GiB/s 1.6236 GiB/s 1.6258 GiB/s]
                 change:
                        time:   [-1.8332% -1.5425% -1.2486%] (p = 0.00 < 0.05)
                        thrpt:  [+1.2644% +1.5667% +1.8674%]
                        Performance has improved.
write_batch primitive/4096 values float with NaNs
                        time:   [316.17 µs 317.04 µs 318.12 µs]
                        thrpt:  [172.77 MiB/s 173.36 MiB/s 173.84 MiB/s]
                 change:
                        time:   [-1.5436% -0.5349% +0.5982%] (p = 0.34 > 0.05)
                        thrpt:  [-0.5946% +0.5377% +1.5678%]
                        No change in performance detected.
write_batch nested/4096 values primitive list
                        time:   [1.1048 ms 1.1141 ms 1.1251 ms]
                        thrpt:  [1.8504 GiB/s 1.8687 GiB/s 1.8843 GiB/s]
                 change:
                        time:   [-12.662% -12.001% -11.382%] (p = 0.00 < 0.05)
                        thrpt:  [+12.844% +13.638% +14.497%]
                        Performance has improved.
write_batch nested/4096 values primitive list non-null
                        time:   [1.1968 ms 1.1984 ms 1.2002 ms]
                        thrpt:  [1.7310 GiB/s 1.7336 GiB/s 1.7358 GiB/s]
                 change:
                        time:   [-2.9200% -2.6182% -2.3050%] (p = 0.00 < 0.05)
                        thrpt:  [+2.3594% +2.6886% +3.0078%]
                        Performance has improved.

Very nice improvements for primitives, minor improvements once bloom filters or string types are involved. I think the last two benchmarks are named incorrectly, they actually write 3 columns of types int32, bool and utf8.

@jhorstmann
Copy link
Contributor Author

jhorstmann commented Jul 2, 2025

@Dandandan wait a second with merging, I think I found another hotspot regarding the bloom filters

@Dandandan
Copy link
Contributor

@Dandandan wait a second with merging, I think I found another hotspot regarding the bloom filters

Sure thing!

@alamb

This comment was marked as outdated.

@alamb
Copy link
Contributor

alamb commented Jul 2, 2025

Those are some pretty impressive numbers @jhorstmann

@jhorstmann
Copy link
Contributor Author

Updated results for bloom filter benchmarks. There is a very weird effect on my machine where running only these benchmarks is much faster than running them interleaved with non-bloom benchmarks.

write_batch primitive/4096 values primitive with bloom filter
                        time:   [988.28 µs 994.28 µs 1.0013 ms]
                        thrpt:  [175.71 MiB/s 176.95 MiB/s 178.02 MiB/s]
                 change:
                        time:   [-79.512% -79.286% -79.015%] (p = 0.00 < 0.05)
                        thrpt:  [+376.53% +382.77% +388.08%]
                        Performance has improved.
write_batch primitive/4096 values primitive non-null with bloom filter
                        time:   [942.81 µs 948.45 µs 955.48 µs]
                        thrpt:  [180.55 MiB/s 181.89 MiB/s 182.98 MiB/s]
                 change:
                        time:   [-80.272% -80.166% -80.062%] (p = 0.00 < 0.05)
                        thrpt:  [+401.56% +404.19% +406.89%]
                        Performance has improved.
write_batch primitive/4096 values string with bloom filter
                        time:   [873.56 µs 875.61 µs 877.94 µs]
                        thrpt:  [2.2783 GiB/s 2.2843 GiB/s 2.2897 GiB/s]
                 change:
                        time:   [-15.921% -15.128% -14.435%] (p = 0.00 < 0.05)
                        thrpt:  [+16.870% +17.824% +18.936%]
                        Performance has improved.
write_batch primitive/4096 values string with bloom filter #2
                        time:   [423.74 µs 425.03 µs 426.34 µs]
                        thrpt:  [296.02 MiB/s 296.93 MiB/s 297.84 MiB/s]
                 change:
                        time:   [-25.445% -25.221% -25.007%] (p = 0.00 < 0.05)
                        thrpt:  [+33.345% +33.728% +34.129%]
                        Performance has improved.
write_batch primitive/4096 values string dictionary with bloom filter
                        time:   [422.49 µs 423.03 µs 423.65 µs]
                        thrpt:  [2.3794 GiB/s 2.3829 GiB/s 2.3859 GiB/s]
                 change:
                        time:   [-20.954% -20.800% -20.664%] (p = 0.00 < 0.05)
                        thrpt:  [+26.046% +26.263% +26.508%]
                        Performance has improved.
write_batch primitive/4096 values string non-null with bloom filter
                        time:   [1.1120 ms 1.1149 ms 1.1177 ms]
                        thrpt:  [1.7886 GiB/s 1.7932 GiB/s 1.7979 GiB/s]
                 change:
                        time:   [-11.517% -11.248% -10.961%] (p = 0.00 < 0.05)
                        thrpt:  [+12.310% +12.673% +13.016%]
                        Performance has improved.

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

🤖 ./gh_compare_arrow.sh Benchmark Script Running
Linux aal-dev 6.11.0-1016-gcp #16~24.04.1-Ubuntu SMP Wed May 28 02:40:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing parquet-writing-performance (9d6a5f5) to 19a14dc diff
BENCH_NAME=arrow_writer
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench arrow_writer
BENCH_FILTER=
BENCH_BRANCH_NAME=parquet-writing-performance
Results will be posted here when complete

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

🤖: Benchmark completed

Details

group                                                                     main                                   parquet-writing-performance
-----                                                                     ----                                   ---------------------------
write_batch nested/4096 values primitive list                             2.39      4.6±0.08ms   463.3 MB/sec    1.00   1928.4±8.97µs  1105.5 MB/sec
write_batch nested/4096 values primitive list non-null                    2.63      5.7±0.11ms   374.6 MB/sec    1.00      2.2±0.01ms   984.9 MB/sec
write_batch primitive/4096 values bool                                    4.74    355.9±8.98µs     3.0 MB/sec    1.00     75.1±0.51µs    14.1 MB/sec
write_batch primitive/4096 values bool non-null                           7.22    303.6±9.78µs  1930.3 KB/sec    1.00     42.1±0.14µs    13.6 MB/sec
write_batch primitive/4096 values float with NaNs                         1.86  1111.1±16.13µs    49.5 MB/sec    1.00    597.8±1.35µs    91.9 MB/sec
write_batch primitive/4096 values primitive                               2.52      2.1±0.04ms    83.2 MB/sec    1.00    839.8±5.59µs   209.5 MB/sec
write_batch primitive/4096 values primitive non-null                      2.99  1982.7±90.41µs    87.0 MB/sec    1.00    663.2±2.89µs   260.1 MB/sec
write_batch primitive/4096 values primitive non-null with bloom filter    3.45     21.5±0.30ms     8.0 MB/sec    1.00      6.2±0.82ms    27.7 MB/sec
write_batch primitive/4096 values primitive with bloom filter             2.76     21.5±1.36ms     8.2 MB/sec    1.00      7.8±0.29ms    22.6 MB/sec
write_batch primitive/4096 values string                                  2.63  1036.2±18.46µs   121.8 MB/sec    1.00    393.6±2.59µs   320.6 MB/sec
write_batch primitive/4096 values string dictionary                       5.32      2.8±0.13ms   364.9 MB/sec    1.00    531.8±4.54µs  1940.9 MB/sec
write_batch primitive/4096 values string dictionary with bloom filter     5.93      4.8±0.24ms   215.3 MB/sec    1.00    807.9±6.96µs  1277.7 MB/sec
write_batch primitive/4096 values string non-null                         3.44      4.8±0.13ms   427.2 MB/sec    1.00  1394.7±11.63µs  1467.9 MB/sec
write_batch primitive/4096 values string non-null with bloom filter       4.80     10.8±0.08ms   190.2 MB/sec    1.00      2.2±0.02ms   912.7 MB/sec
write_batch primitive/4096 values string with bloom filter                5.74      9.5±0.27ms   214.9 MB/sec    1.00  1659.3±20.99µs  1234.4 MB/sec

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

🤖: Benchmark completed

😮

group                                                                     main                                   parquet-writing-performance
-----                                                                     ----                                   ---------------------------
write_batch nested/4096 values primitive list                             2.39      4.6±0.08ms   463.3 MB/sec    1.00   1928.4±8.97µs  1105.5 MB/sec
write_batch nested/4096 values primitive list non-null                    2.63      5.7±0.11ms   374.6 MB/sec    1.00      2.2±0.01ms   984.9 MB/sec
write_batch primitive/4096 values bool                                    4.74    355.9±8.98µs     3.0 MB/sec    1.00     75.1±0.51µs    14.1 MB/sec
write_batch primitive/4096 values bool non-null                           7.22    303.6±9.78µs  1930.3 KB/sec    1.00     42.1±0.14µs    13.6 MB/sec
write_batch primitive/4096 values float with NaNs                         1.86  1111.1±16.13µs    49.5 MB/sec    1.00    597.8±1.35µs    91.9 MB/sec
write_batch primitive/4096 values primitive                               2.52      2.1±0.04ms    83.2 MB/sec    1.00    839.8±5.59µs   209.5 MB/sec
write_batch primitive/4096 values primitive non-null                      2.99  1982.7±90.41µs    87.0 MB/sec    1.00    663.2±2.89µs   260.1 MB/sec
write_batch primitive/4096 values primitive non-null with bloom filter    3.45     21.5±0.30ms     8.0 MB/sec    1.00      6.2±0.82ms    27.7 MB/sec
write_batch primitive/4096 values primitive with bloom filter             2.76     21.5±1.36ms     8.2 MB/sec    1.00      7.8±0.29ms    22.6 MB/sec
write_batch primitive/4096 values string                                  2.63  1036.2±18.46µs   121.8 MB/sec    1.00    393.6±2.59µs   320.6 MB/sec
write_batch primitive/4096 values string dictionary                       5.32      2.8±0.13ms   364.9 MB/sec    1.00    531.8±4.54µs  1940.9 MB/sec
write_batch primitive/4096 values string dictionary with bloom filter     5.93      4.8±0.24ms   215.3 MB/sec    1.00    807.9±6.96µs  1277.7 MB/sec
write_batch primitive/4096 values string non-null                         3.44      4.8±0.13ms   427.2 MB/sec    1.00  1394.7±11.63µs  1467.9 MB/sec
write_batch primitive/4096 values string non-null with bloom filter       4.80     10.8±0.08ms   190.2 MB/sec    1.00      2.2±0.02ms   912.7 MB/sec
write_batch primitive/4096 values string with bloom filter                5.74      9.5±0.27ms   214.9 MB/sec    1.00  1659.3±20.99µs  1234.4 MB/sec

@alamb alamb changed the title Improvements for parquet writing performance Improvements for parquet writing performance (2x-5x) Jul 3, 2025
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 @jhorstmann -- that is amazing

if self.repeat_count >= 8 {
// The current RLE run has ended and we've gathered enough. Flush first.
assert_eq!(self.bit_packed_count, 0);
debug_assert_eq!(self.bit_packed_count, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

it is a good call to remove the runtime overhead in release mode

/// The arrow array
array: ArrayRef,

/// cached logical nulls of the array.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also a good idea to avoid having to clone (even though it is just a few ars) each time

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

BTW @jhorstmann -- twitter noticed that the initial results in the description don't reflect what I just measured

https://x.com/qrilka/status/1940751432560660823

Perhaps the description needs to be updated with your latest results?

@jhorstmann
Copy link
Contributor Author

The PR description needs an update now that bloom filters are also improved. I also ran my initial benchmarks with target-cpu=native, maybe the baseline was already higher with that flag. I'll try to reproduce this also with default target features.

@jhorstmann
Copy link
Contributor Author

jhorstmann commented Jul 3, 2025

@alamb I can't reproduce these benchmark numbers. The branch results looks plausible, but the numbers for main look much slower than what I'm getting locally. Can you verify that the main results include the changes from PR #7823 / commit a9f316b? it might also be that the benchmark names ending in #2 confuse criterion or critcmp, since I can't seem to filter on these and do not see them in the critcmp output.

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

@alamb I can't reproduce these benchmark numbers. The branch results looks plausible, but the numbers for main look much slower than what I'm getting locally. Can you verify that the main results include the changes from PR #7823 / commit a9f316b? it might also be that the benchmark names ending in #2 confuse criterion or critcmp, since I can't seem to filter on these and do not see them in the critcmp output.

My scripts compare the branch against git merge-base apache/main (aka where this branch was branched from main). Perhaps you can merge up from main and I'll run the tests again?

@jhorstmann jhorstmann force-pushed the parquet-writing-performance branch from 9d6a5f5 to e7f32e9 Compare July 3, 2025 16:08
@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

🤖 ./gh_compare_arrow.sh Benchmark Script Running
Linux aal-dev 6.11.0-1016-gcp #16~24.04.1-Ubuntu SMP Wed May 28 02:40:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing parquet-writing-performance (e7f32e9) to 52ad7d7 diff
BENCH_NAME=arrow_writer
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench arrow_writer
BENCH_FILTER=
BENCH_BRANCH_NAME=parquet-writing-performance
Results will be posted here when complete

@jhorstmann
Copy link
Contributor Author

My scripts compare the branch against git merge-base apache/main (aka where this branch was branched from main). Perhaps you can merge up from main and I'll run the tests again?

Ah, that makes sense, I think I created both branches in parallel. This PR is rebased now, that should give a better comparison.

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

My scripts compare the branch against git merge-base apache/main (aka where this branch was branched from main). Perhaps you can merge up from main and I'll run the tests again?

Ah, that makes sense, I think I created both branches in parallel. This PR is rebased now, that should give a better comparison.

I restarted the benchmark

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

🤖: Benchmark completed

Details

group                                                                     main                                   parquet-writing-performance
-----                                                                     ----                                   ---------------------------
write_batch nested/4096 values primitive list                             1.11      2.1±0.01ms  1001.7 MB/sec    1.00   1913.2±7.21µs  1114.3 MB/sec
write_batch nested/4096 values primitive list non-null                    1.06      2.3±0.02ms   909.4 MB/sec    1.00      2.2±0.02ms   967.6 MB/sec
write_batch primitive/4096 values bool                                    1.44    107.9±0.87µs     9.8 MB/sec    1.00     75.1±0.36µs    14.1 MB/sec
write_batch primitive/4096 values bool non-null                           1.36     56.6±0.19µs    10.1 MB/sec    1.00     41.6±0.58µs    13.8 MB/sec
write_batch primitive/4096 values float with NaNs                         1.06    629.5±2.01µs    87.3 MB/sec    1.00    595.1±2.55µs    92.4 MB/sec
write_batch primitive/4096 values primitive                               1.35   1126.0±5.34µs   156.2 MB/sec    1.00    834.8±3.68µs   210.8 MB/sec
write_batch primitive/4096 values primitive non-null                      1.24    823.8±3.29µs   209.4 MB/sec    1.00    662.2±3.75µs   260.5 MB/sec
write_batch primitive/4096 values primitive non-null with bloom filter    1.24     10.2±0.37ms    16.9 MB/sec    1.00      8.3±0.38ms    20.9 MB/sec
write_batch primitive/4096 values primitive with bloom filter             1.28     10.5±0.41ms    16.8 MB/sec    1.00      8.2±0.25ms    21.5 MB/sec
write_batch primitive/4096 values string                                  1.18    462.4±2.07µs   272.9 MB/sec    1.00    393.0±0.96µs   321.2 MB/sec
write_batch primitive/4096 values string dictionary                       1.00    524.1±4.21µs  1969.4 MB/sec    1.03    538.4±6.15µs  1917.2 MB/sec
write_batch primitive/4096 values string dictionary with bloom filter     1.22   987.4±10.01µs  1045.4 MB/sec    1.00    806.5±8.02µs  1280.0 MB/sec
write_batch primitive/4096 values string non-null                         1.00  1396.9±13.36µs  1465.6 MB/sec    1.00   1392.6±9.69µs  1470.1 MB/sec
write_batch primitive/4096 values string non-null with bloom filter       1.09      2.5±0.04ms   824.7 MB/sec    1.00      2.3±0.04ms   899.7 MB/sec
write_batch primitive/4096 values string with bloom filter                1.24      2.1±0.02ms   982.9 MB/sec    1.00  1676.3±18.35µs  1221.8 MB/sec

@alamb
Copy link
Contributor

alamb commented Jul 3, 2025

Ah, 25% - 44% -- will adjust

@alamb alamb changed the title Improvements for parquet writing performance (2x-5x) Improvements for parquet writing performance (25%-44%) Jul 3, 2025
Copy link
Contributor

@etseidl etseidl left a comment

Choose a reason for hiding this comment

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

🚀

Thanks @jhorstmann!

@Dandandan Dandandan merged commit 5649e39 into apache:main Jul 4, 2025
30 checks passed
@alamb
Copy link
Contributor

alamb commented Jul 4, 2025

🚀 indeed

@Dandandan
Copy link
Contributor

🚀

🚀

🚀

jhorstmann added a commit to jhorstmann/arrow-rs that referenced this pull request Aug 22, 2025
This method was removed in apache#7824, which introduced an optimized code
path for writing bloom filters on little-endian architectures. The
method was however still used in the big-endian code-path. Due to the
use of `#[cfg(target_endian)]` this went unnoticed in CI.

Fixes apache#8207
alamb pushed a commit that referenced this pull request Aug 23, 2025
This method was removed in #7824, which introduced an optimized code
path for writing bloom filters on little-endian architectures. The
method was however still used in the big-endian code-path. Due to the
use of `#[cfg(target_endian)]` this went unnoticed in CI.

Fixes #8207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Perf: Investigate and improve parquet writing performance
4 participants