Skip to content

Commit

Permalink
Start Amp only if PHP-Scoper is used
Browse files Browse the repository at this point in the history
Starting Amp has an overhead and increase the likelyhood of rising an issue due to how Amp works. As
a result, it is better to not have to start it unless necessary. So far the current compactors are
fast enough to not require parallel processing, the build from Box without PHP-Scoper goes from 5s
with parallel processing to 3s without.

Closes box-project#135
  • Loading branch information
theofidry committed Apr 28, 2018
1 parent 85dc37a commit 92ddc2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Box.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ private function processContents(array $files, string $cwd): array
return [$local, $processedContents];
};

return is_parallel_processing_enabled()
return is_parallel_processing_enabled() && false === ($this->scoper instanceof NullScoper)
? wait(parallelMap($files, $processFile))
: array_map($processFile, $files)
;
Expand Down

0 comments on commit 92ddc2f

Please sign in to comment.