Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Dec 17, 2022

There is already initialization early in ApplicationFileProcessor::run()

$fileInfos = $this->fileFactory->createFileInfosFromPaths($configuration->getPaths(), $configuration);

public function run(Configuration $configuration, InputInterface $input): array
{
$fileInfos = $this->fileFactory->createFileInfosFromPaths($configuration->getPaths(), $configuration);

so, internal call:

$filePaths = $this->createFileInfosFromPaths($paths, $configuration);

inside createFromPaths() method no longer needed, as it can just consume existing defined initialization $fileInfos string array data.

It only happen on non-parallel configuration.

so:

✔️ Remove double Loop (only once at initialization already)
✔️ Remove double run clear cache
✔️ Remove double method call internally.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit 7d5d1ce into main Dec 17, 2022
@TomasVotruba TomasVotruba deleted the performance-remove-unnecessary-re-call-create-fileinfos-from-paths branch December 17, 2022 08:27
@TomasVotruba
Copy link
Member

Nice catch: 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants