Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use parallel static analysis by default (#10000)
Modern PCs have multi-core. RuboCop has `--parallel` option, but it is not used by default. This means that there is extra core resources for static analysis because multi-core is not being used effectively. This PR will be parallel processing by default, so RuboCop will run faster in proportion to number of cores. Options that can be parallel processing, such as `--only`, `--except`, and others have the same default behavior. However, there are options that cannot be parallel processing, such as auto-correction and others, so they are serial processing as before. `--parallel` can be a hidden option for some users. This change is expected to reduce user's wait time for running RuboCop. Below is an example on my development PC. Before: ```console % cd path/to/rubocop ./exe/rubocop --display-time (snip) 1293 files inspected, no offenses detected Finished in 61.09493000002112 seconds ``` After: ```console % cd path/to/rubocop ./exe/rubocop --display-time (snip) 1293 files inspected, no offenses detected Finished in 10.13813699997263 seconds ``` If user's PC has a lot of cores, memory and RuboCop targets a lot of files to inspect, it will be effective. One concern is that parallel processing uses more memory. For example, Ruby's MJIT is off by default as an example of concerning about memory consumption in a low memory production runtime (e.g. Heroku's minimum Dyno). However, RuboCop is a development tool, I assume that it will be fine in most cases. If user want to use it in a low memory production runtime, user can specify `--no-parallel`. Note: JRuby and Windows are not supported based on #4537.
- Loading branch information
Showing
6 changed files
with
85 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#10000](https://github.com/rubocop/rubocop/pull/10000): Parallel static analysis by default. ([@koic][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters