-
Notifications
You must be signed in to change notification settings - Fork 185
Use crc-fast for increased performance #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The crc-fast crate is a drop-in replacement that delivers considerably higher performance (>100GiB/s on latest x86_64 Intel, >50GiB/s on latest x86_64 AMD and aarch64 AWS Graviton, including similar gains for much older x86, x86_64, and aarch64 processors). It has a fast, safe, table-based software fallback for non-accelerated systems.
1.89.0 is still within this project’s MSRV (stable is currently 1.92.0). It’s the release that stabilized the AVX512 intrinsics, which help supply many (but not all) of these impressive performance improvements on x86_64 CPUs.
|
This adds a significant number of dependencies for the |
Byron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for conducting this experiment, it's much appreciated!
However, due to the MSRV increase which can't be feature toggled, I don't think it's anything we could do without a major version bump and without massive evidence that this would make a huge difference in the ecosystem.
But let's work on that.
I am putting it into Request changes so it can't be accidentally merged while we figure out the details.
And I agree with @jongiddy that this would have to go behind a feature toggle to control the added dependencies.
Since we can't really release with it as long as the rust-version is specified, I don't really know where this PR can go unless we wait until we naturally reach that MSRV, or until we have an incredibly good reason to raise the MSRV in a breaking release just to allow the crc_fast crate behind a feature toggle.
|
@Byron The |
|
The Also, the README in this repository describes a pretty aggressive MSRV policy of only supporting the current and immediately previous stable Rust compilers. That might not match the actual intent? |
|
Yeah, the MSRV policy and the |
|
Thanks everyone for chiming in. It seems this PR needs a justification by providing a repeatable benchmark with both crates. To facilitate that, it would be easiest to add the new crate behind a feature toggle. When both are in place, and once there is interest by consumers of Does that sound feasible, or am I missing something? |
Reduces dependency tree (removes ‘crc’, ‘crc-catalog’, and’ rustversion’).
|
Thanks for the discussion. I just published Fair point on benchmarking, I've been using it in some heavy CRC projects, but it's possible the impact might not be as large with this crate. I'll see if I can find some time to benchmark with / without and see. 👍 |
|
I turned it back to draft for now, and would appreciate a task list in the PR itself to see where it's at. PS: I just now realised that you are the author of the |
|
Oh, sorry, fair point. I hadn't even considered the disclaimer. To be clear, I'm not really motivated by promoting the crate for personal interests, I'm motivated by the increased performance gains (and reduced costs and energy consumption) that we've seen in other projects, and would like to share the wins. If it's not a material performance win for Thanks for the conversation. This is my first real Rust project, so I'm still learning the ins and outs of the community, best practices, etc. Sorry again for not mentioning that I was the author. |
|
Thanks! Yes, let's see if this crate can make a difference. Personally, I am ignorant enough to not even know where CRC hashes are used here. It will be interesting. Please note that I added some checkboxes to the PR itself to keep track of its state more easily - do feel free to edit at will. |
The crc-fast crate is a drop-in replacement that delivers considerably higher performance (>100GiB/s on latest x86_64 Intel, >50GiB/s on latest x86_64 AMD and aarch64 AWS Graviton, including similar gains for much older x86, x86_64, and aarch64 processors) than crc32fast.
It has a fast, safe, table-based software fallback for non-accelerated systems (PowerPC, RISC-V, etc).
Bumps
rust-versionto 1.89.0 since that's when the AVX512 intrinsics stabilized, which is still within this project's MSRV (stable is currently 1.92.0). AVX512 provided a pretty dramatic boost for modern x86_64 CPUs.Tasks
Tasks for Byron
crc-fastto see if it could be a replacement forcrc32-fast, particularly if there is a difference regardingunsafe.