Skip to content

[perf] Speed up AddReturnTypeDeclarationRector by resolving class reflection only for static return type - #8658

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-perf-add-return-type-static-reflection
Oct 15, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-perf-add-return-type-static-reflection

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Performance refactor of AddReturnTypeDeclarationRector. No behavior change - all 9 fixtures pass unchanged.

resolveClassReflection() was called on every configured return-type change, but its result is used only when the new type is a SimpleStaticType (to rebuild it as a StaticType). The reflection resolution is now moved inside that branch, so the common configured cases (plain object/scalar/array return types) no longer pay for it.

…g class reflection only for static return type
@TomasVotruba TomasVotruba changed the title [TypeDeclaration] Speed up AddReturnTypeDeclarationRector by resolving class reflection only for static return type [perf] Speed up AddReturnTypeDeclarationRector by resolving class reflection only for static return type Oct 15, 2026
@TomasVotruba
TomasVotruba merged commit 99f2f4b into main Oct 15, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-perf-add-return-type-static-reflection branch October 15, 2026 10:48
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