Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Performance improvement: Remove unnecessary re-call FileFactory::createFileInfosFromPaths() #3210

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
2 participants