-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Cop idea: Enumerable#each + push
vs Enumerable#map
#397
Comments
I've benchmarked it (ruby 3.3.0). ydakuka@yauhenid:~/ruby-docker-app$ docker run ruby-app
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
Warming up --------------------------------------
slow 12.748k i/100ms
fast 20.212k i/100ms
Calculating -------------------------------------
slow 135.016k (± 1.1%) i/s - 675.644k in 5.004757s
fast 203.381k (± 0.9%) i/s - 1.031M in 5.068794s
Comparison:
fast: 203381.5 i/s
slow: 135016.1 i/s - 1.51x slower |
Due to the case of #384, can you verify the results with the latest Ruby 3.3.0dev? It might be a good idea for fastruby to redo benchmark with the latest Ruby version. It might be better to wait until after the scheduled release of Ruby 3.3 next month, rather than doing it now. |
I agree. After the release I'll do the benchmarks. |
Related: rubocop/rubocop#11878 |
I've updated benchmarks in my repos. |
https://github.com/fastruby/fast-ruby#enumerableeach--push-vs-enumerablemap-code
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: