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

Optimize forwarded calls #313

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Optimize forwarded calls #313

merged 1 commit into from
Sep 3, 2024

Conversation

marcandre
Copy link
Contributor

@marcandre marcandre commented Sep 1, 2024

Fixes [#312]

@Earlopain do you have a minute to review the PR? 🙏

@bbatsov
Copy link
Contributor

bbatsov commented Sep 2, 2024

Did you manage to get the same 3% speedup?

@Earlopain
Copy link
Contributor

This looks fine to me, benchmarking confirms:

Current:
$ hyperfine -w 3 -r 20 "bundle exec rubocop Rakefile" 
Benchmark 1: bundle exec rubocop Rakefile
  Time (mean ± σ):      2.907 s ±  0.133 s    [User: 2.458 s, System: 0.242 s]
  Range (min … max):    2.802 s …  3.408 s    20 runs

PR:  
$ hyperfine -w 3 -r 20 "bundle exec rubocop Rakefile" 
Benchmark 1: bundle exec rubocop Rakefile
  Time (mean ± σ):      2.695 s ±  0.084 s    [User: 2.297 s, System: 0.229 s]
  Range (min … max):    2.596 s …  2.918 s    20 runs

This is with the changes from rubocop itself already applied. It's a weaker machine than the other benchmark so numbers are different and apparently matter even more since it's about 7% just with this change. I haven't tested but it's probably that file system operations are similarly fast while the CPU is not (or something similar to that effect).

Either way, still achives the original goal. Thanks!

@marcandre marcandre merged commit f7fd091 into master Sep 3, 2024
19 checks passed
@marcandre marcandre deleted the simple_forwardable branch September 3, 2024 02:24
@marcandre
Copy link
Contributor Author

Thanks!

Released as 1.32.2

I'd recommend using that in rubocop too.

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