talira

RuboCop Performance

Performance optimization analysis for Ruby code, as a RuboCop extension

open sourceMITfree

RuboCop Performance is an official extension to RuboCop that adds about 50 cops which flag slow Ruby idioms and suggest faster equivalents. It's loaded as a RuboCop plugin from .rubocop.yml, the command line or a Rake task, and its cops are configured like RuboCop's own. Installed as the rubocop-performance gem; MIT licence, from the RuboCop project.

Problems it solves

  • catch slow Ruby code patterns automatically in code review
  • have my Ruby linter suggest faster equivalents for common methods
  • find allocation-heavy and slow string and array code in a Rails app with a linter

Features

  • about 50 cops that flag slow Ruby idioms
  • loads as a RuboCop plugin from .rubocop.yml, the command line or a Rake task
  • cops configured and disabled like RuboCop's own

Alternatives

The same job

These do what RuboCop Performance does.

  1. RuboCop Rails RuboCop extension with cops for Rails best practices and conventions
  2. RuboCop A Ruby static code analyzer and formatter, based on the community Ruby style guide.
  3. Standard Ruby Unconfigurable Ruby linter and formatter built on RuboCop
  4. RuboCop RSpec RuboCop extension with cops for RSpec test files
  5. Herb A modern templating language for the HTML+ERB you already have.
  6. Reek Code smell detector for Ruby

Compare RuboCop Performance with the top 3