-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
Comments
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 |
on my macbook m4 pro it takes ~1minute (87% of the overall time). I will play a bit with the idea |
That's really huge number. |
Just guessing, it probably related with some php extension on your macOS interferring tcp connection, like IMAP, which try to lookup connection in everytime parallel process created, I wrote a blog post about it https://samsonasik.wordpress.com/2023/09/30/handle-slow-php-cli-with-imap-extension-on-macos/ |
thanks for the input. my modules:
I have a feeling its somehow related to antivirus or security software intercepting filesystem access |
It is possibly a way of PHPStan container creation on the first execution, try run rector 2 times:
and see if there is time different. which on first execution, the system try to verify some integrity of files/permission by some software/antivirus. |
I am closing it, on parallel, it only proces passed chunked files per collection of files that per-job process already collected in per-total jobs basis, so the files verification only on very first process. I am using m1 mac mini with only 8gb ram, and it run immediatelly for many files. So if it it take long on starter, probably related with some extension or software that verify files in your mac. |
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
e.g. we could try to turn the
FileCacheStorage->load()
method into a generator and return several times in chunks (or file by file?)The text was updated successfully, but these errors were encountered: