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

Improve LocalConstantFinder performance #3652

Merged
merged 4 commits into from Apr 22, 2023

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 22, 2023

Do cheaper checks first. Similar to #3651

return null;
}
$const = $this->findConstantByName($class, $constatName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be moved down to last statement to improve performance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@samsonasik
Copy link
Member

Thank you @staabm

@samsonasik samsonasik enabled auto-merge (squash) April 22, 2023 16:08
@samsonasik
Copy link
Member

not sure why test randomly crash

@staabm
Copy link
Contributor Author

staabm commented Apr 22, 2023

not sure why test randomly crash

I have no idea either. looks like a bug in php-src or even deeper

@samsonasik samsonasik merged commit c935e91 into rectorphp:main Apr 22, 2023
37 checks passed
@staabm staabm deleted the fast-const-finder branch April 22, 2023 16:22
samsonasik pushed a commit that referenced this pull request May 8, 2023
* Improve LocalConstantFinder performance

* simplify

* typo

* fix typo
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