-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Use std::arch for crc checking if available #19
Comments
Thanks for the reminder! I'd prefer to hold off for at least a few releases after We could add this behind a feature or otherwise do version sniffing in a
IMO, we should always be aiming for runtime detection unless there is a specific reason why that is unsuitable. Runtime detection has the wonderful benefit of being completely transparent. Compile time checks require compilers of the software to build non-portable binaries with special flags. Runtime detection "just works." I don't think there should be any problem with runtime detection here. (The chief problem with runtime detection is amortizing the CPU check. Typically, the SIMD work will dwarf it anyway, but there could be cases where it is a bit unnatural.) |
Related to this, are there plans to move the crc code to its own library for others to use since the current one is relatively slower than the one in snappy. |
There are no specific plans on my part. For the most part, I didn't want to add yet another crc crate, but I also don't have the bandwidth to collaborate with others on improving an existing crate. Others are certainly welcome to do it though! |
There's a comment in the source already but I thought I'd open an issue for this too, now that x86 intrinsics will be available to us in stable Rust 1.27. I've got a crc function I've been using that looks something like:
With SSE4.2 support that's approximately, roughly somewhere in the ballpark of much faster than our fallback implementation.
I'm not so sure yet how we'd want to approach the
target_feature
stuff for a library, I'm guessing the static check for SSE4.2 support would be better than a runtime check? I also excluded 32bit because I didn't need it.The text was updated successfully, but these errors were encountered: