-
Notifications
You must be signed in to change notification settings - Fork 28
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
Digest is ~5x slower on Ruby 3.x then 2.x #35
Comments
@rhenium Can you look this? This performance regression may be intentional. Should we migrate it to like |
Heres a gist of what I was personally using to benchmark: https://gist.github.com/baseballlover723/c02a6f803ac4147585d183d0430b205e. It might be useful to you all. |
My guess would be you get Ruby 3 level of performance (significantly slower) on Ruby 2 if you pass the The only code I can see in the current digest repository that uses openssl is the gemspec: |
Yes, this is likely caused by ruby/ruby#3149. The performance degradation is not deliberate but somewhat expected because it now uses the bundled C implementation instead of OpenSSL's optimized implementation. |
So people who want the higher performance of the Ruby 2.x version on ruby 3.x should just switch from using |
Digest is ~5x slower for SHA1, SHA2, and SHA256 on Ruby 3.x compared to Ruby 2.x. See https://gist.github.com/morimori/1330095#gistcomment-3975819 for more details and the benchmark. Note that I tried benchmarking with Ruby 3.0.3 with both Digest 3.0.0 and 3.1.0, as well as Ruby 3.1.0 and still had the same performance. I suspect that it has to do with the extraction of Digest into its own gem.
The text was updated successfully, but these errors were encountered: