Repository navigation
[perf] Reuse rebuilt ClassReflection by class content hash to stop memory growth on class refresh - #8731
Conversation
|
@TomasVotruba all green and performance improved from latest patch Before #8728 in changed mode never rebuilt the reflection (the stale-reflection bug), so compare changed mode against Growth now scales with the number of distinct class versions, not with the number of refreshes 👍 All green 🎉 let's merge 👍 |
|
LGTM 👍 Which Drupal test was broken? Can you send me link? |
|
Here original drupal-rector build that broken https://github.com/rectorphp/rector-src/actions/runs/39412220242/job/118599891995#step:6:11 I was sent a patch PR there as it was using ClassReflection which was not rebuild after Class Node changed: The issue with dropping guard can be even more without the patch, this is what I found right now. |
@TomasVotruba per your request at:
This PR
Here the current comparison:
9939155e2a)main(#8728 + #8729,uniqid()key)Run on both branches:
The key is the class content, not
spl_object_id(), because rules change the class node in place.The new
ClassReflectionRefreshInPlacetest covers it: with an object-id key it loops forever, adding the trait again on every pass.