librscrc

Crates.iolibrscrc
lib.rslibrscrc
version0.1.0
sourcesrc
created_at2022-07-07 19:19:06.312682
updated_at2022-07-07 19:19:06.312682
descriptionlibrscrc is a collection of crc32 algorithms with support for various approaches and custom polynomial.
homepage
repositoryhttps://github.com/psvri/librscrc
max_upload_size
id621365
size56,448
Palladium (psvri)

documentation

README

librscrc

CircleCI

Librscrc is a collection of crc32 algorithms with support for various approaches like simd and table based lookup and custom polynomial implemented in rust.

Simd is currently supported on the following architectures

  • x86
  • x86_64
  • aarch64

Unsafe code is used for calls to intrinsics. These can be opted out by setting default-features = false in Cargo.toml, there by disabling simd and hardware crc intrinsics support.

Performance

Your mileage may vary based on the hardware used. This section is meant to only give comparison of various approaches.

  • Nightly compiler is required to use hardware crc instructions on aarch64 with feature flag "nightly" enable.
  • Simd and hardware instructions are used if the required cpu features are detected at run time. In case it's not found, it falls back to lookup based approach.
  • Simd approach is based on the paper published by intel
Algorithm(crc32c) x86_64(throughput) aarch64(throughput)
naive 249.97 MiB/s 221.81 MiB/s
lookup 3.6584 GiB/s 2.2660 GiB/s
hardware crc 10.483 GiB/s 21.026 GiB/s
simd 25.479 GiB/s 18.079 GiB/s
Commit count: 29

cargo fmt