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.