An extension of RuboCop focused on code performance checks.
742
stars
1,176
commits
Ruby
primary language
Sep 9, 2026
updated
Performance optimization analysis for your projects, as an extension to RuboCop.
Just install the rubocop-performance gem
$ gem install rubocop-performance
or if you use bundler put this in your Gemfile
gem 'rubocop-performance', require: false
You need to tell RuboCop to load the Performance extension. There are three ways to do this:
Put this into your .rubocop.yml.
plugins: rubocop-performance
Alternatively, use the following array notation when specifying multiple extensions.
plugins:
- rubocop-other-extension
- rubocop-performance
Now you can run rubocop and it will automatically load the RuboCop Performance
cops together with the standard cops.
[!NOTE] The plugin system is supported in RuboCop 1.72+. In earlier versions, use
requireinstead ofplugins.
$ rubocop --plugin rubocop-performance
require 'rubocop/rake_task'
RuboCop::RakeTask.new do |task|
task.plugins << 'rubocop-performance'
end
All cops are located under
lib/rubocop/cop/performance, and contain
examples/documentation.
In your .rubocop.yml, you may treat the Performance cops just like any other
cop. For example:
Performance/Size:
Exclude:
- lib/example.rb
You can read a lot more about RuboCop Performance in its official docs.
RuboCop Performance is compatible with RuboCop core.
See the compatibility documentation for further details.
Note: Performance cops are all MRI focused and are highly dependent of the version of MRI you're using.
Checkout the contribution guidelines.
rubocop-performance is MIT licensed. See the accompanying file for
the full text.
(top 30 of 71)
Ruby
100.0%
An extension of RuboCop focused on code performance checks.
742
stars
1,176
commits
Ruby
primary language
Sep 9, 2026
updated
Performance optimization analysis for your projects, as an extension to RuboCop.
Just install the rubocop-performance gem
$ gem install rubocop-performance
or if you use bundler put this in your Gemfile
gem 'rubocop-performance', require: false
You need to tell RuboCop to load the Performance extension. There are three ways to do this:
Put this into your .rubocop.yml.
plugins: rubocop-performance
Alternatively, use the following array notation when specifying multiple extensions.
plugins:
- rubocop-other-extension
- rubocop-performance
Now you can run rubocop and it will automatically load the RuboCop Performance
cops together with the standard cops.
[!NOTE] The plugin system is supported in RuboCop 1.72+. In earlier versions, use
requireinstead ofplugins.
$ rubocop --plugin rubocop-performance
require 'rubocop/rake_task'
RuboCop::RakeTask.new do |task|
task.plugins << 'rubocop-performance'
end
All cops are located under
lib/rubocop/cop/performance, and contain
examples/documentation.
In your .rubocop.yml, you may treat the Performance cops just like any other
cop. For example:
Performance/Size:
Exclude:
- lib/example.rb
You can read a lot more about RuboCop Performance in its official docs.
RuboCop Performance is compatible with RuboCop core.
See the compatibility documentation for further details.
Note: Performance cops are all MRI focused and are highly dependent of the version of MRI you're using.
Checkout the contribution guidelines.
rubocop-performance is MIT licensed. See the accompanying file for
the full text.
(top 30 of 71)
Ruby
100.0%