Parallel on Windows 11 enviroment #12026
-
|
Hi, i would like to ask how PHPStan 2.0.1 works on Windows 11 with parallel process. CPU: i9-13900H (14 cores, 20 threads) php "vendor/bin/phpstan" analyse --configuration "bin/phpstan.neon" -vvv --ansiThis is the same as above: D:\WebDevelopment\Laragon\bin\php\php-8.3.9-Win32-vs16-x64\php.exe "D:\WebDevelopment\Localhost\PROJECT\master\vendor/bin/phpstan" analyse --configuration "bin/phpstan.neon" -vvv --ansiResult of PHPStan: PHP runtime version: 8.3.9
PHP version for analysis: 8.3.9 (from runtime)
PHPStan version: 2.0.1
PHPStan running from:
D:/WebDevelopment/Localhost/PROJECT/master/vendor/phpstan/phpstan
Extension installer: Not installed
Included configs from Composer packages:
phpstan/phpstan-nette (extension.neon): 2.0.0
phpstan/phpstan-nette (rules.neon): 2.0.0
Discovered Composer project root:
D:/WebDevelopment/Localhost/PROJECT/master
Parallel processing scheduler:
# of detected CPU core: 1
# of analysed files: 2434
# of jobs: 122
# of spawned processes: 1
Elapsed time: 4 minutes 57 seconds
Used memory: 498 MBBy the output, PHPStan use only one thread instead of 20 threads. Can anyone tell me how to configure PHPStan to use more than one thread? If i run the same on Gitlab CI i get this output: Parallel processing scheduler:
# of detected CPU cores: 2
# of analysed files: 2434
# of jobs: 122
# of spawned processes: 2
Elapsed time: 2 minutes 21 seconds
Used memory: 916 MBI traied to set configuration of PHPStan: parameters:
parallel:
maximumNumberOfProcesses: 20But it does not do anything. Settings of PHPStan: includes:
- %currentWorkingDirectory%/vendor/phpstan/phpstan-nette/extension.neon
- %currentWorkingDirectory%/vendor/phpstan/phpstan-nette/rules.neon
- %currentWorkingDirectory%/.phpstan.neon
parameters:
scanDirectories:
- %currentWorkingDirectory%/App
- %currentWorkingDirectory%/vendor
- %currentWorkingDirectory%/libs
paths:
- %currentWorkingDirectory%/App
excludePaths:
- %currentWorkingDirectory%/App/Bridge/Mall/*
- %currentWorkingDirectory%/App/Plugins/Barion/Src/PaymentGate/Barion.php
tmpDir:
%currentWorkingDirectory%/temp/phpstan
level: 5
editorUrlTitle: '%%relFile%%:%%line%%'CPU overal usage while PHPStan running is around 10-15%. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
PHPStan uses this class to detect the number of CPU cores: https://github.com/phpstan/phpstan-src/blob/2.0.x/src/Process/CpuCoreCounter.php So it uses this library: https://github.com/theofidry/cpu-core-counter You can try to debug it what's going on there, find out how to precisely detect the number of CPUs on your machine, and contribute that to the library. |
Beta Was this translation helpful? Give feedback.
Good thinking! Will be fixed after this PR: phpstan/phpstan-src#3632 (you could have sent it and earn a contribution :))