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

[Performance] Call cached class names collection on FamilyRelationsAnalyzer #5879

Merged
merged 5 commits into from
May 15, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented May 15, 2024

@mfn @dorrogeray here continuation of PR:

to improve performance, to ensure call $this->reflectionProvider->getClass() on service that only use it, which is FamilyRelationsAnalyzer, and as FamilyRelationsAnalyzer is shared service, create a flag for it that it already cached.

Before 58.689 seconds

➜  rector-src git:(main) time bin/rector     
 2180/2180 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

                                                                                                                        
 [OK] Rector is done!    

After 37.014

time bin/rector process --clear-cache
 2180/2180 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

                                                                                                                        
 [OK] Rector is done!                                                                                                   
                                                                                                                        

bin/rector process --clear-cache  223.62s user 9.74s system 630% cpu 37.014 total

Closes rectorphp/rector#8637
Closes rectorphp/rector#8638

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 8ab5e97 into main May 15, 2024
42 checks passed
@samsonasik samsonasik deleted the performance-cache branch May 15, 2024 01:45
@samsonasik
Copy link
Member Author

@mfn @dorrogeray Please try latest dev-main now, it should be faster

composer config minimum-stability dev
composer config prefer-stable true
composer require --dev rector/rector:dev-main

Tested on rector-src code base, it got almost twice faster :)

Before 58.689 seconds

➜  rector-src git:(main) time bin/rector     
 2180/2180 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

                                                                                                                        
 [OK] Rector is done!    

After 37.014

time bin/rector process --clear-cache
 2180/2180 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

                                                                                                                        
 [OK] Rector is done!                                                                                                   
                                                                                                                        

bin/rector process --clear-cache  223.62s user 9.74s system 630% cpu 37.014 total

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