Skip to content
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

Added Openssl feature #125

Merged
merged 5 commits into from
Jan 24, 2024
Merged

Added Openssl feature #125

merged 5 commits into from
Jan 24, 2024

Conversation

nomick
Copy link
Contributor

@nomick nomick commented Jan 16, 2024

Changing the sha2 implementation to openssl may increase the speed tremendously. On a Cascade Lake Xeon we saw 60% increase in PUT performance. As openssl may not be a good choice in every situation, it is capsuled in a cargo feature.
The unwraps may be not wanted, but avoiding them would change the function signature.

WARP before:

Operation: PUT. Concurrency: 20

  • Average:216.98 MiB/s, 21.70 obj/s

Throughput, split into 111 x 1s:

  • Fastest:244.7MiB/s, 24.47 obj/s
  • 50% Median:217.6MiB/s, 21.76 obj/s
  • Slowest:193.1MiB/s, 19.31 obj/s

WARP after:

Operation: PUT. Concurrency: 20

  • Average:354.65 MiB/s, 35.46 obj/s

Throughput, split into 65 x 1s:

  • Fastest:377.3MiB/s, 37.73 obj/s
  • 50% Median:355.9MiB/s, 35.59 obj/s
  • Slowest:324.6MiB/s, 32.46 obj/s

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Nugine
Copy link
Owner

Nugine commented Jan 17, 2024

So the sha256 in openssl is much faster than pure rust sha2? It's suprising.
We should add a simple benchmark to track this difference and report to RustCrypto/hashes/sha2.

@nomick
Copy link
Contributor Author

nomick commented Jan 17, 2024

Unfortunately. they are perfectly aware of this. See RustCrypto/hashes#327

@St4NNi
Copy link
Contributor

St4NNi commented Jan 21, 2024

Was curious about this, I guess it really depends on your specific CPU. If your CPU supports the SHA-NI extension openssl and RustCrypto perform about the same, if not RustCrypto is up to 2x slower.

A quick test on our EPYC Milan (Zen3) and on my personal Zen4 machine showed, as expected, no measurable difference between RustCrypto and OpenSSL.

@Nugine Nugine merged commit 2d1e5d5 into Nugine:main Jan 24, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants