We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Performance/StringIdentifierArgument
As per rubocop/rubocop#12383 (comment) in the same vein as rubocop/rubocop#12373
Benchmark script:
require 'benchmark/ips' puts `ruby -v` def foo_bar end bar = "bar" Benchmark.ips do |x| x.report('symbol arg') { send(:"foo_#{bar}") } x.report('string arg') { send("foo_#{bar}") } x.compare! end
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux-musl] Warming up -------------------------------------- symbol arg 641.253k i/100ms string arg 602.373k i/100ms Calculating ------------------------------------- symbol arg 6.385M (± 0.6%) i/s - 32.063M in 5.022123s string arg 6.023M (± 0.5%) i/s - 30.119M in 5.000717s Comparison: symbol arg: 6384545.4 i/s string arg: 6023007.5 i/s - 1.06x slower
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
As per rubocop/rubocop#12383 (comment) in the same vein as rubocop/rubocop#12373
Benchmark script:
The text was updated successfully, but these errors were encountered: