Skip to content

Commit ca52add

Browse files
committed
[parallel] bump default threads from 16 to 32 to keep up with modern technology, alligned with phpstan setup
1 parent 3823c97 commit ca52add

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

src/Config/RectorConfig.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Rector\Contract\Rector\ConfigurableRectorInterface;
1515
use Rector\Contract\Rector\RectorInterface;
1616
use Rector\DependencyInjection\Laravel\ContainerMemento;
17+
use Rector\Enum\Config\Defaults;
1718
use Rector\Exception\ShouldNotHappenException;
1819
use Rector\Skipper\SkipCriteriaResolver\SkippedClassResolver;
1920
use Rector\Validation\RectorConfigValidator;
@@ -93,8 +94,11 @@ public function disableParallel(): void
9394
SimpleParameterProvider::setParameter(Option::PARALLEL, false);
9495
}
9596

96-
public function parallel(int $processTimeout = 120, int $maxNumberOfProcess = 16, int $jobSize = 16): void
97-
{
97+
public function parallel(
98+
int $processTimeout = 120,
99+
int $maxNumberOfProcess = Defaults::PARALLEL_MAX_NUMBER_OF_PROCESS,
100+
int $jobSize = 16
101+
): void {
98102
SimpleParameterProvider::setParameter(Option::PARALLEL, true);
99103
SimpleParameterProvider::setParameter(Option::PARALLEL_JOB_TIMEOUT_IN_SECONDS, $processTimeout);
100104
SimpleParameterProvider::setParameter(Option::PARALLEL_MAX_NUMBER_OF_PROCESSES, $maxNumberOfProcess);

src/Configuration/RectorConfigBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Rector\Contract\Rector\ConfigurableRectorInterface;
2121
use Rector\Contract\Rector\RectorInterface;
2222
use Rector\Doctrine\Set\DoctrineSetList;
23+
use Rector\Enum\Config\Defaults;
2324
use Rector\Exception\Configuration\InvalidConfigurationException;
2425
use Rector\Php\PhpVersionResolver\ComposerJsonPhpVersionResolver;
2526
use Rector\PHPUnit\Set\PHPUnitSetList;
@@ -90,7 +91,7 @@ final class RectorConfigBuilder
9091

9192
private int $parallelTimeoutSeconds = 120;
9293

93-
private int $parallelMaxNumberOfProcess = 16;
94+
private int $parallelMaxNumberOfProcess = Defaults::PARALLEL_MAX_NUMBER_OF_PROCESS;
9495

9596
private int $parallelJobSize = 16;
9697

src/Enum/Config/Defaults.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Enum\Config;
6+
7+
final class Defaults
8+
{
9+
/**
10+
* @var int
11+
*/
12+
public const PARALLEL_MAX_NUMBER_OF_PROCESS = 32;
13+
}

0 commit comments

Comments
 (0)