Skip to content

RuboCop: Improve performance

Peter Leitzen requested to merge pl-rubocop-performance-patches into master

What does this MR do and why?

This MR improves performance of RuboCop - specially it reduces the runtime of rubocop job by ~24 % (from 3359 seconds to 2553 seconds 🚀).

See #377469 for more details and profiling information.

It also adds a new utility bin/rubocop-profile to profile bundled RuboCop.

How to set up and validate locally

# Run full scan with cold cache
rm -fr tmp/rubocop_cache && time bundle exec rubocop --parallel

# Or run a subset of files
rm -fr tmp/rubocop_cache && time bundle exec rubocop {spec,app}/models/project*

# Profile yourself!
bin/rubocop-profile {spec,app}/models/project*
stackprof tmp/stackprof.dump

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports