-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
Performance regression since 1.0.5 #8637
Performance regression since 1.0.5 #8637
Comments
we are aware of that :), that's due to the needs of child class detection : I was trying to improve it by cache the classname collections: but temporary closed due to possible side effect, I will check if there is better way to "cache" without relying on Cache object. |
Thanks! But: why close, when it's not fixed? The regression is very noticeable on big projects. We might need to roll back to 1.0.4 |
That may require some architecture change, as on parallel, the Closing it as may cause multiple conflict, and better to force change when it is ready. It will done when it is done :) |
Closing for now to avoid distractions and conflict, and better peace in my mind. I am aware of it, and will revisit later with hopefully better solution. |
I created new PR: for it. |
Based on the mention in rectorphp/rector-src#5879 (comment) , I tested with
$ time composer rector-tests
> @php vendor/bin/rector process --config=rector-tests.php
2980/2980 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] Rector is done!
real 1m30.967s
user 8m39.800s
sys 0m16.978s
$ time composer rector-tests
> @php vendor/bin/rector process --config=rector-tests.php
1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] Rector is done!
real 0m20.660s
user 0m19.555s
sys 0m0.759s A bit better, but still too slow: But still a far cry from 1.0.4 (re-did the same test again)
$ time composer rector-tests
> @php vendor/bin/rector process --config=rector-tests.php
2980/2980 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] Rector is done!
real 1m13.126s
user 8m20.583s
sys 0m17.299s
$ time composer rector-tests
> @php vendor/bin/rector process --config=rector-tests.php
1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] Rector is done!
real 0m3.500s
user 0m2.855s
sys 0m0.451s |
Thank you for testing. When there is file change, the class collection need to be re-collected for multiple runs to keep the collection steady. I was trying to collect classes only when service to get child classes called, but got possible multiple init on: I will look more on improvement when possible. |
Can someone share a reproducer for this perf problem? |
Reopening to address this clearly. |
Thank you very much. I refrained from commenting the previous closures, but it was not how I would have expected to issues to be treated, which were clearly not fixed. Thus: thank you for acknowledging this ❤️ |
@mfn I created PR to drop children class detection I will let @TomasVotruba to decide ;) |
Thanks @samsonasik for quick work 👍 Thanks for patience to all 🙏 I'm now travelling and connection is sometime challange to get here. I know I should have check this more deeply sooner. Resolved in rectorphp/rector-src#5995 |
Bug Report
Runtime of rector did skyrocket with 1.0.5, 1.0.4 was fine.
Before:
After:
In both cases I took a single file out of ~3k and just added a blank line.
In both cases it detected correctly only a single modified file, but the execution time is very much different.
Minimal PHP Code Causing Issue
Config(s)
rector-common.php
rector-tests.php
Expected Behaviour
Be as fast as before 😅
I can't share more details, this is a private repo. But let me know if you've any idea what I could test.
The text was updated successfully, but these errors were encountered: