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

chunked file finder #8966

Open
staabm opened this issue Jan 8, 2025 · 3 comments
Open

chunked file finder #8966

staabm opened this issue Jan 8, 2025 · 3 comments
Labels

Comments

@staabm
Copy link
Contributor

staabm commented Jan 8, 2025

Feature Request

when changing rules in big codebases, I can see in blackfire profiles, that a huge portion of the time rector processes is spent in the file finder (not the actual code modifications).

I wonder whether we can/could chunk the file finding and e.g. start worker processes for the e.g. the first chunk of files, while we are still analyzing the file-system to find more files..?

see

grafik

e.g. we could try to turn the FileCacheStorage->load() method into a generator and return several times in chunks (or file by file?)

@staabm staabm added the feature label Jan 8, 2025
@TomasVotruba
Copy link
Member

Thanks for investigation 👍

Without much thinking, I think PHPStan resource loader needs all files before hand, and would be a blocker for this.

How does PHPStan handle file loading?

What is the time spent on these ~700 files?

If you find any way to improve this part, I'm all ears

@staabm
Copy link
Contributor Author

staabm commented Jan 8, 2025

What is the time spent on these ~700 files?

on my macbook m4 pro it takes ~1minute (87% of the overall time).

I will play a bit with the idea

@TomasVotruba
Copy link
Member

That's really huge number.
We have a project with 5 000 files and Rector stars working under 5 seconds. I'm on Ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants