rubocop icon indicating copy to clipboard operation
rubocop copied to clipboard

Performance issues with custom configuration

Open mockdeep opened this issue 1 year ago • 0 comments

When passing a custom configuration option to RuboCop via the programmatic API (a la haml-lint) it is significantly slower than using the default configuration.


Expected behavior

There should be no performance difference when passing a custom configuration.

Actual behavior

It takes about twice as long.

Steps to reproduce the problem

There's probably a better way, but I ran into this with haml-lint when specifying a custom HAML_LINT_RUBOCOP_CONF. It looks like if you call out to RuboCop in a loop with a --config option it triggers this issue. We happen to have an unrelated warning caused by our .rubocop.yml, and one thing I'm noticing is that the warning gets output a single time when using the default .rubocop.yml but a bunch of times when using a custom configuration. So maybe it is reloading the configuration every time?

RuboCop version

$ [bundle exec] rubocop -V
1.36.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.0.4) [x86_64-linux]
  - rubocop-graphql 0.14.6
  - rubocop-performance 1.15.0
  - rubocop-rails 2.16.0
  - rubocop-rake 0.6.0
  - rubocop-rspec 2.13.1```

mockdeep avatar Sep 22 '22 01:09 mockdeep