Skip to content

Commit

Permalink
YUUUUUUUGE performance improvement for full analysis with heavily pop…
Browse files Browse the repository at this point in the history
…ulated cache

this change reduces full analysis time of pmmp/PocketMine-MP from 33sec to 13sec (no result cache)
  • Loading branch information
dktapps committed Oct 24, 2021
1 parent 635c256 commit 5b784ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Command/CommandHelper.php
Expand Up @@ -48,7 +48,8 @@ public static function begin(
bool $manageMemoryLimitFile = true,
bool $debugEnabled = false,
?string $singleReflectionFile = null,
?string $singleReflectionInsteadOfFile = null
?string $singleReflectionInsteadOfFile = null,
bool $cleanupContainerCache = true
): InceptionResult
{
if (!$allowXdebug) {
Expand Down Expand Up @@ -257,7 +258,9 @@ public static function begin(
throw new \PHPStan\Command\InceptionNotSuccessfulException();
}

$containerFactory->clearOldContainers($tmpDir);
if ($cleanupContainerCache) {
$containerFactory->clearOldContainers($tmpDir);
}

if (count($paths) === 0) {
$errorOutput->writeLineFormatted('At least one path must be specified to analyse.');
Expand Down
4 changes: 3 additions & 1 deletion src/Command/WorkerCommand.php
Expand Up @@ -111,7 +111,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$allowXdebug,
false,
false,
$singleReflectionFile
$singleReflectionFile,
null,
false
);
} catch (\PHPStan\Command\InceptionNotSuccessfulException $e) {
return 1;
Expand Down

0 comments on commit 5b784ad

Please sign in to comment.