-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Optimise post rectors #6240
Optimise post rectors #6240
Conversation
@samsonasik code updated |
Thanks for the improvement 👍 Could you share few time measurements, as on the other PR? |
@TomasVotruba time improvements are not really noticeable, I see the same timings more or less with the previous version and this one (the results vary a little but they vary equally in both versions). It is more a question of trying to be optimal overall so that all these little increments don't add up |
We're adding a state to readonly service here, which I don't see as a good practise. |
I have tested this without using parallel, which gives more stable results that don't vary too much and I can see numbers similar to these: |
Thanks for checking 👍
You're right. Let's ship this. Could you rebase the PR? |
61b69d4
to
fc4206d
Compare
@TomasVotruba rebased |
Thank you 🙏 |
When I was investigating rectorphp/rector#8793 yesterday I noticed that the
NameImportingPostRector
post rector could be optimised because it was unnecessarily calculating the use statements for every node so I decided to add a fix. I took the opportunity to look at the other post rectors and found some other possible optimisations. They are small optimisations, nothing really very noticeable, but, as they say, every little helps!See the PR comments for more info