Problem/Motivation
phpcs has a --parallel option that significantly speeds up test runs by using multiple PHP processes. Compare:
$ time vendor/bin/phpcs -ps --standard=core/phpcs.xml.dist
............................................................ 60 / 11909 (1%)
...
............................. 11909 / 11909 (100%)
Time: 3 mins, 26.21 secs; Memory: 208MB
real 3m26.606s
user 3m21.222s
sys 0m3.417s
vs
$ time vendor/bin/phpcs -ps --standard=core/phpcs.xml.dist --parallel=$(nproc)
........ 8 / 8 (100%)
Time: 1 mins, 24.88 secs; Memory: 6MB
real 1m24.992s
user 6m56.904s
sys 0m6.074s
Steps to reproduce
Proposed resolution
Add --parallel=$(nproc) to the lines that invoke phpcs.
Remaining tasks
Check that the script still fails correctly when coding standards are not met.
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3312089-3.patch | 1.27 KB | longwave |
Comments
Comment #2
wim leersComment #3
longwaveComment #5
smustgrave commentedSince the 10.1 tests pass assuming this is good.
Comment #7
catchCommitted/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!
Comment #8
wim leers… and this just shaved some valuable time off of each DrupalCI run! 🤩👏 Thanks, @longwave & @smustgrave!
Comment #10
xjmThis introduced #3407360: Commit check script: nproc does not exist on Darwin. It's not all that serious because it does not prevent the script from completing, but it does mean Macs still run the script without parallelization and throws a warning that might confuse people (like me).