Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PropertyInfo] Adds static cache toPhpStanExtractor#54894

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:7.2frommvhirsch:phpstan-extractor
May 31, 2024

Conversation

@mvhirsch
Copy link
Contributor

@mvhirschmvhirsch commentedMay 12, 2024
edited by OskarStark
Loading

QA
Branch?7.2
Bug fix?no (performance)
New feature?no
Deprecations?no
Issues
LicenseMIT

I was able to detect a performance penalty when using dozens of traits in even more classes. ThePhpStanExtractor creates aNameScope every time, but afaik this can be cached like inPhpDocExtractor (see#32188).

The performance impact is impressive, as it reduces the time needed for myTestCase by 30%. SeeBlackfire profile comparison.

OskarStark and andreybolonin reacted with rocket emoji
@derrabus
Copy link
Member

Please target 7.1. We usually don't merge performance improvements into LTS branches.

dunglas reacted with thumbs up emoji

@derrabusderrabus modified the milestones:6.4,7.1May 13, 2024
@xabbuh
Copy link
Member

Shouldn't we now also implement theResetInterface to prevent memory leaks?

@xabbuhxabbuh modified the milestones:7.1,7.2May 15, 2024
@mvhirsch
Copy link
ContributorAuthor

Shouldn't we now also implement theResetInterface to prevent memory leaks?

If so, thePhpDocExtractor should implement it too, I guess.

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedMay 17, 2024
edited
Loading

implement the ResetInterface to prevent memory leaks?

If all we store is class metadata, we don't need a reset IMHO as the leak is upper bounded, and resetting might effect performance of long running kernels for little memory savings in the end.

xabbuh, mvhirsch, and derrabus reacted with thumbs up emoji

returnnull;
}

$nameScope =$this->contexts[$class.$declaringClass] ??=$this->nameScopeFactory->create($class,$declaringClass);

Choose a reason for hiding this comment

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

Suggested change
$nameScope =$this->contexts[$class.$declaringClass] ??=$this->nameScopeFactory->create($class,$declaringClass);
$nameScope =$this->contexts[$class.'/'.$declaringClass] ??=$this->nameScopeFactory->create($class,$declaringClass);

Choose a reason for hiding this comment

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

would it make sense to move this inside the loop, right before the nested foreach?:

$nameScope ??=$this->contexts[$class.'/'.$declaringClass] ??=$this->nameScopeFactory->create($class,$declaringClass);

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

would it make sense to move this inside the loop, right before the nested foreach?:

You mean here?

Sounds reasonable to me. It may make sense to skip creating one unless really needed (and since my change is all about re-using a created one, it hardly influences performance).

@fabpot
Copy link
Member

Thank you@mvhirsch.

@fabpotfabpot merged commit6a888e8 intosymfony:7.2May 31, 2024
@mvhirschmvhirsch deleted the phpstan-extractor branchMay 31, 2024 10:50
@fabpotfabpot mentioned this pull requestOct 27, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@fabpotfabpotfabpot approved these changes

@OskarStarkOskarStarkOskarStark approved these changes

@lyrixxlyrixxAwaiting requested review from lyrixx

@ycerutoycerutoAwaiting requested review from yceruto

@welcoMatticwelcoMatticAwaiting requested review from welcoMattic

@kbondkbondAwaiting requested review from kbond

@chalasrchalasrAwaiting requested review from chalasr

@jderussejderusseAwaiting requested review from jderusse

@xabbuhxabbuhAwaiting requested review from xabbuh

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

@derrabusderrabusAwaiting requested review from derrabus

Assignees

No one assigned

Projects

None yet

Milestone

7.2

Development

Successfully merging this pull request may close these issues.

8 participants

@mvhirsch@derrabus@xabbuh@nicolas-grekas@fabpot@dunglas@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp