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

[Core] Improve performance on AstResolver and ClassLikeAstResolver #3234

Merged
merged 5 commits into from Dec 22, 2022

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Dec 22, 2022

Currently, we have isset() to verify that collection of class/method exists, but that doesn't match when previous search saved as null data, eg:

// to avoid parsing missing function again
$this->functionsByName[$functionReflection->getName()] = null;

the isset() will always got false result when it fill null value, this PR change to use isset() early, then apply array_key_exists as fallback so it will use the null value as is when it found,

see https://3v4l.org/JrQ9n

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik
Copy link
Member Author

I applied isset() check early, array_key_exists() as fallback in case the null data exists 👍

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba
Copy link
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit 7f8f9f8 into main Dec 22, 2022
@TomasVotruba TomasVotruba deleted the core-improve-performance-isset branch December 22, 2022 11:31
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