-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: add more information about parallel
option
#10
Comments
Best course of action would be to just automate it. Since the original thread phpstan and others started to use https://github.com/theofidry/cpu-core-counter for that |
@mabar Nice idea and something which could be considered as a feature request some time in the future. Having said that, that doesn't negate the validity of the current issue which is about the lack of documentation for how things are now. |
To answer your questions
Ideally always, it speeds up analysis a lot
It looks like it does. Even initial phpcbf run on large legacy codebases is quite fast.
If you don't plan to run the checks nonstop, it's fine to just use all cores. On huge codebases, it helps a lot. On small codebases using more cores than necessary slows down execution, but the speed gain is still massive and optimizing for each small package is just not worth it. Perhaps codesniffer itself may decide to use less cores than given available, based on overall amount of files and amount of cached and unchanged files. Using
I am currently at exactly 200 sniffs from codesniffer and slevomat/coding-standard and never had issues related to parallel processing.
Error handling. I had some very long file, whose processing was stuck. I had to disable parallelism in order to identify the file. Sadly, I don't remember why exactly was it a problem. |
Caveat: it doesn't work on Windows.
Anecdotal evidence is not an answer. There are some sniffs which check things across a codebase - like the |
As per #419, parallelization is silently disabled if the I'll kick-off with this suggestion to the Configuration Options page. Maybe we can also have one section in Advanced Usage, and link there if it needs further explanation/details?
|
I still think it'd be helpful if a message is printed to the user, even if only in verbose mode. I spent quite a while trying to figure out why it wasn't parallelized at one point, and having the message would have saved me the time of debugging it. Documentation isn't enough, IMHO. |
@mbomb007 Agreed. I'll be opening a proposal ticket for a |
@Luc45 Thank you for getting the docs started. I do think it needs to be fleshed out a little more.
|
While it doesn't directly address this issue, PR #447 is a proposal to improve the help screens, including improved information on the help screen about the Reviews and testing of that PR would be appreciated. |
Regarding making |
Enable parallel processing for PHPCS sniffs. Documentation: PHPCSStandards/PHP_CodeSniffer#10 Co-authored-by: anton-vlasenko <antonvlasenko@git.wordpress.org> Co-authored-by: desrosj <desrosj@git.wordpress.org> Co-authored-by: ironprogrammer <ironprogrammer@git.wordpress.org> Co-authored-by: jrfnl <jrf@git.wordpress.org>
Enable parallel processing for PHPCS sniffs. Documentation: PHPCSStandards/PHP_CodeSniffer#10 Co-authored-by: anton-vlasenko <antonvlasenko@git.wordpress.org> Co-authored-by: desrosj <desrosj@git.wordpress.org> Co-authored-by: ironprogrammer <ironprogrammer@git.wordpress.org> Co-authored-by: jrfnl <jrf@git.wordpress.org>
Enable parallel processing for PHPCS sniffs. Documentation: PHPCSStandards/PHP_CodeSniffer#10 Co-authored-by: anton-vlasenko <antonvlasenko@git.wordpress.org> Co-authored-by: desrosj <desrosj@git.wordpress.org> Co-authored-by: ironprogrammer <ironprogrammer@git.wordpress.org> Co-authored-by: jrfnl <jrf@git.wordpress.org>
Enable parallel processing for PHPCS sniffs. Documentation: PHPCSStandards/PHP_CodeSniffer#10 Co-authored-by: anton-vlasenko <antonvlasenko@git.wordpress.org> Co-authored-by: desrosj <desrosj@git.wordpress.org> Co-authored-by: ironprogrammer <ironprogrammer@git.wordpress.org> Co-authored-by: jrfnl <jrf@git.wordpress.org>
Repost from squizlabs/PHP_CodeSniffer#1732:
👉🏻 The thread in the original post contains lots of useful comments and would be a good starting point to start writing this up.
The text was updated successfully, but these errors were encountered: