Skip to content

[perf] Speed up ChangeMethodVisibilityRector with cheap method name guard before ScopeFetcher - #8681

Open
alfredbez wants to merge 1 commit into
rectorphp:mainfrom
alfredbez:perf/change-method-visibility-cheap-guard
Open

alfredbez wants to merge 1 commit into
rectorphp:mainfrom
alfredbez:perf/change-method-visibility-cheap-guard

Conversation

@alfredbez

Copy link
Copy Markdown
Contributor

Follow-up to recent rule performance enhancements (e.g. #8671, #8672, #8673).

ChangeMethodVisibilityRector currently calls ScopeFetcher::fetch($node) and resolves the parent class name on every class method in the project, even when the method name is not among the configured method names.

Checking method names against the configured list upfront skips ScopeFetcher::fetch($node) and parent class resolution for all non-matching class methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant