paddor commented on issue #9307: URL: https://github.com/apache/arrow-rs/issues/9307#issuecomment-7410520765
@alamb, small follow-up. Before opening anything, I wanted to ask: would a PR that swaps `lz4_flex` for `lz4rip` in `arrow-ipc` and `parquet` be welcome, or is it still too young? Today: - First release 2026-06-05. No breaking release since 0.12.0 in October. The `Standard` profile, which the PR would use, came in a patch release this week. It compresses about as well as `lz4_flex`. - `#![forbid(unsafe_code)]` in all its crates. arrow-rs builds `lz4_flex` in its unsafe mode, I assume for speed. - Blocks and frames round-trip with C lz4 1.10 in its tests. 17 cargo-fuzz targets. - MSRV 1.88, the same as arrow-rs. Numbers from your criterion benches, with lz4rip 0.12.15. `main` at 7aa93123, #12423 (ac0cdf9) cherry-picked onto it, CPU i7-8700B, medians of 2-3 rotated runs. `ipc_reader.rs` is #12423's, which adds the wide cases: | `ipc_reader` | main | #12423 | lz4rip | #12423 + lz4rip | |---|---:|---:|---:|---:| | `no_validation/read_10/lz4` | 3.71 ms | 3.17 ms (-15%) | 1.76 ms (-52%) | 1.31 ms (-65%) | | `read_10/lz4` | 4.06 ms | 3.52 ms (-13%) | 2.11 ms (-48%) | 1.64 ms (-60%) | | `read_10/lz4/rows=256/threads=1` | 455 µs | 199 µs (-56%) | 168 µs (-63%) | 144 µs (-68%) | | `read_10/lz4/rows=256/threads=16` | 2.41 ms | 1.07 ms (-56%) | 955 µs (-60%) | 820 µs (-66%) | | `read_10/lz4/rows=8192/threads=1` | 4.18 ms | 3.61 ms (-14%) | 2.22 ms (-47%) | 1.74 ms (-58%) | | `read_10/lz4/rows=8192/threads=16` | 13.9 ms | 12.6 ms (-10%) | 8.88 ms (-36%) | 7.35 ms (-47%) | | `read_10/wide_200x4096/lz4_64kib_blocks` | 22.6 ms | 13.2 ms (-42%) | 20.3 ms (-10%) | 14.1 ms (-37%) | | `read_10/wide_200x4096/lz4_4096kib_blocks` | 443 ms | 13.2 ms (-97%) | 23.1 ms (-95%) | 14.1 ms (-97%) | | `read_10/wide_20x131072/lz4_64kib_blocks` | 127 ms | 121 ms (-5%) | 128 ms (+1%) | 123 ms (-4%) | | `read_10/wide_20x131072/lz4_4096kib_blocks` | 209 ms | 122 ms (-42%) | 174 ms (-17%) | 124 ms (-41%) | The swap and #12423 combine. On the wide Int32 batches, #12423 + lz4rip is 2-7% slower than #12423 alone. The writer is slower on 8192-row batches. The cause is short matches in the `Decimal128` column: | `ipc_writer` | main | lz4rip | |---|---:|---:| | `write_10/lz4` | 4.01 ms | 4.29 ms (+7%) | | `encode_10/lz4/rows=8192/threads=1` | 4.08 ms | 4.39 ms (+8%) | | `encode_10/lz4/rows=8192/threads=16` | 15.6 ms | 17.8 ms (+15%) | | `encode_10/lz4/rows=65536/threads=1` | 32.6 ms | 30.6 ms (-6%) | | `encode_10/lz4/rows=65536/threads=16` | 116 ms | 111 ms (-4%) | | parquet `compression` | main | lz4rip | |---|---:|---:| | `compress LZ4_RAW - alphanumeric` | 96 µs | 85 µs (-12%) | | `compress LZ4_RAW - words` | 2.30 ms | 2.30 ms (0%) | | `decompress LZ4_RAW - alphanumeric` | 76 µs | 68 µs (-10%) | | `decompress LZ4_RAW - words` | 436 µs | 442 µs (+1%) | - Hadoop `LZ4`, same rows: -11%, 0%, -9%, +1%. - Sizes: +22 B on the 427 KB `words` output, and +0.4% on ClickBench `hits_0` written as `LZ4_RAW` Parquet. The PR would change the dependency, `lz4_flex::` to `lz4rip::` in the two `compression.rs` files, and set `Profile::Standard` for encoding. The `lz4` features stay. The implicit `lz4_flex` feature goes away, so it would wait for a major release. The `arrow-ipc` and `parquet` tests pass unchanged, including #12423's frame-shape tests on top of it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
