houseme opened a new pull request, #660:
URL: https://github.com/apache/avro-rs/pull/660

   ## Summary
   
   - replace the optional Snappy `crc32fast` dependency with `crc-fast` 1.10.0
   - use `crc_fast::crc32_iso_hdlc(...)` for Avro Snappy block CRC32 calculation
   - add a regression test for the standard CRC-32/ISO-HDLC trailer bytes
   - bump workspace and CI MSRV from 1.88.0 to 1.89.0 because `crc-fast` 1.10.0 
requires Rust 1.89
   
   Closes #659.
   
   ## Rationale
   
   The Snappy codec only needs CRC32 over contiguous decoded/uncompressed 
blocks, so `crc-fast`'s specialized one-shot `crc32_iso_hdlc` helper fits the 
existing call sites directly. The algorithm remains CRC-32/ISO-HDLC, and the 
new test locks the public Avro trailer format to the standard `b"123456789" -> 
0xcbf43926` check value encoded as big-endian bytes.
   
   For this exact usage pattern, a local microbenchmark on Darwin arm64 
(`Mac17,6`, `rustc 1.98.1`) showed `crc-fast` improving throughput over the 
current `crc32fast::Hasher::new(); update(); finalize()` flow:
   
   | Block size | crc32fast | crc-fast | Speedup |
   | ---: | ---: | ---: | ---: |
   | 128 B | 12.12 GiB/s | 21.02 GiB/s | 1.73x |
   | 1 KiB | 10.93 GiB/s | 70.03 GiB/s | 6.41x |
   | 16 KiB | 22.56 GiB/s | 81.98 GiB/s | 3.63x |
   | 1 MiB | 33.27 GiB/s | 101.22 GiB/s | 3.04x |
   | 16 MiB | 33.42 GiB/s | 97.76 GiB/s | 2.93x |
   
   `crc-fast` is configured with `default-features = false, features = ["std"]` 
to avoid its default `ffi`/`panic-handler` features while retaining std-backed 
runtime SIMD detection.
   
   ## Testing
   
   - `cargo check -p apache-avro --features snappy`
   - `cargo test -p apache-avro --features snappy,derive snappy`
   - `cargo fmt --all --check`
   - `cargo build --all-features --all-targets`
   - `cargo check -p apache-avro --target aarch64-unknown-linux-gnu --features 
snappy`
   
   Not completed locally:
   
   - `wasm32-unknown-unknown` CI target validation. Installing the target 
locally stalled while downloading `rust-std`, so this should still be watched 
in CI.
   


-- 
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]

Reply via email to