FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: cache the result of ClassReflection::hasMethod method by canvural · Pull Request #3825 · phpstan/phpstan-src · GitHub

feat: cache the result of ClassReflection::hasMethod method - #3825

Merged
ondrejmirtes merged 1 commit into
phpstan:1.12.xfrom
canvural:has-method-cache
Feb 13, 2025
Merged

feat: cache the result of ClassReflection::hasMethod method#3825
ondrejmirtes merged 1 commit into
phpstan:1.12.xfrom
canvural:has-method-cache

Conversation

Copy link
Copy Markdown
Contributor

Hello 👋🏽

This PR caches the result of the ClassReflection::hasMethod method. While investigating some performance issues I found that PHPStan calls method class reflection extensions multiple times for the same class and method. And some extensions might do the actual work in hasMethod method rather than getMethod, for example Larastan does this to cache stuff internally.

I can add tests if wanted. Couldn't think of an easy way to do it right away 😅

Comment thread src/Reflection/ClassReflection.php Outdated
canvural changed the base branch from 2.1.x to 1.12.x February 13, 2025 13:40
canvural changed the base branch from 1.12.x to 2.1.x February 13, 2025 13:40
canvural changed the base branch from 2.1.x to 1.12.x February 13, 2025 13:48
ondrejmirtes merged commit fde29a5 into phpstan:1.12.x Feb 13, 2025

Copy link
Copy Markdown
Member

Thank you.

canvural deleted the has-method-cache branch February 13, 2025 13:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL