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

RenameFunctionRector: prevent repeated isName() calls #5003

Merged
merged 2 commits into from Sep 12, 2023

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 12, 2023

because it showed up in codeigniter profiles

grafik

grafik

@staabm
Copy link
Contributor Author

staabm commented Sep 12, 2023

tested on codeigniter4 codebase:

before this PR:

time php vendor/bin/rector process tests --dry-run --clear-cache
 326/326 [============================] 100%

 [OK] Rector is done!

real    0m58.909s
user    0m0.000s
sys     0m0.031s

after this PR

 time php vendor/bin/rector process tests --dry-run --clear-cache
 326/326 [============================] 100%

 [OK] Rector is done!

real    0m54.508s
user    0m0.031s
sys     0m0.015s

=> 7-8% faster

@samsonasik samsonasik merged commit cbc632c into rectorphp:main Sep 12, 2023
37 checks passed
@samsonasik
Copy link
Member

Thank you @staabm

@staabm staabm deleted the less-naming branch September 12, 2023 11:58
@staabm
Copy link
Contributor Author

staabm commented Sep 12, 2023

interessting side-effect: it seems because we do less isName() calls, we also do less reflection stuff which - in case we reflect on a identifier which does not exit - consumes more memory: (on the codeigniter4 codebase)

grafik

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