feat: add OpenSSL backend for checksum utilities#12412
Open
sylvestre wants to merge 2 commits into
Open
Conversation
Contributor
|
|
|
GNU testsuite comparison: |
Contributor
|
maybe add |
9a1168b to
c30707b
Compare
Contributor
|
I think |
Contributor
|
|
Add an optional OpenSSL (libcrypto) backend for md5/sha1/sha2-family digest computations. OpenSSL provides hand-tuned assembly implementations (AVX2, SSSE3, etc.) that are substantially faster than the pure-Rust crates on CPUs without SHA-NI hardware instructions. Benchmarks on Intel i9-7940X (no SHA-NI), 100MB file: sha256sum: 470ms -> 234ms (was 1.9x slower than GNU, now ~1.0x) sha1sum: 198ms -> 131ms (was 1.6x slower, now ~1.09x) sha512sum: 246ms -> 166ms (was 1.4x slower, now ~0.96x - faster!) md5sum: 185ms -> 174ms (was 1.2x slower, now ~1.09x) Closes uutils#12251
c30707b to
8cf7de3
Compare
oech3
reviewed
May 26, 2026
| `sha384sum`, `sha512sum`, and `cksum`) by using OpenSSL's `libcrypto` instead of | ||
| the pure-Rust digest crates, enable the `openssl` feature: | ||
| ``` | ||
| cargo build --release --features unix,openssl |
Contributor
There was a problem hiding this comment.
Any thought about make's default? Personally, I think we can just make openssl default if it is vendored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an optional OpenSSL (libcrypto) backend for md5/sha1/sha2-family digest computations. OpenSSL provides hand-tuned assembly implementations (AVX2, SSSE3, etc.) that are substantially faster than the pure-Rust crates on CPUs without SHA-NI hardware instructions.
Benchmarks on Intel i9-7940X (no SHA-NI), 100MB file:
sha256sum: 470ms -> 234ms (was 1.9x slower than GNU, now ~1.0x)
sha1sum: 198ms -> 131ms (was 1.6x slower, now ~1.09x)
sha512sum: 246ms -> 166ms (was 1.4x slower, now ~0.96x - faster!)
md5sum: 185ms -> 174ms (was 1.2x slower, now ~1.09x)
Closes #12251