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

Rubocop Proc Linter introduces performance regression #567

Closed
arielvalentin opened this issue Jul 17, 2023 · 2 comments
Closed

Rubocop Proc Linter introduces performance regression #567

arielvalentin opened this issue Jul 17, 2023 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed stale Marks an issue/PR stale

Comments

@arielvalentin
Copy link
Collaborator

https://github.com/fastruby/fast-ruby/blob/main/code/proc-and-block/proc-call-vs-yield.rb

ruby proc-call-vs-yield.rb
Warming up --------------------------------------
          block.call     1.141M i/100ms
       block + yield     1.202M i/100ms
        unused block     1.495M i/100ms
               yield     1.389M i/100ms
Calculating -------------------------------------
          block.call     11.485M (± 1.4%) i/s -     58.175M in   5.066280s
       block + yield     11.910M (± 1.6%) i/s -     60.089M in   5.046587s
        unused block     14.945M (± 5.4%) i/s -     74.725M in   5.019902s
               yield     14.068M (± 1.0%) i/s -     70.858M in   5.037486s

Comparison:
        unused block: 14945101.0 i/s
               yield: 14067574.6 i/s - same-ish: difference falls within error
       block + yield: 11910103.8 i/s - 1.25x  slower
          block.call: 11485071.3 i/s - 1.30x  slower

Edit: to add this was with ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]

We'll probably want to update the linters here https://github.com/open-telemetry/opentelemetry-ruby/pull/1323/files#diff-17159f63bf877cf73b9013894bea9311fb40cd7a4af890df4b0c77ba9fe2828b

Originally posted by @robertlaurin in open-telemetry/opentelemetry-ruby#1492

@arielvalentin arielvalentin changed the title https://github.com/fastruby/fast-ruby/blob/main/code/proc-and-block/proc-call-vs-yield.rb Rubocop Proc Linter introduces performance regression Jul 17, 2023
@arielvalentin arielvalentin added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 18, 2023
@arielvalentin
Copy link
Collaborator Author

@no-reply Thanks for volunteering!

@github-actions
Copy link
Contributor

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

@github-actions github-actions bot added the stale Marks an issue/PR stale label Aug 18, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed stale Marks an issue/PR stale
Projects
None yet
Development

No branches or pull requests

1 participant