-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
perf(core): make DI decorators tree-shakable when used in useFactory
deps config
#40145
perf(core): make DI decorators tree-shakable when used in useFactory
deps config
#40145
Conversation
Related PR: #40122. |
useFactory
deps configuseFactory
deps config
0be3e77
to
ae5904c
Compare
ae5904c
to
78ce6d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty straightforward to me. LGTM.
55f567c
to
5e2e5bd
Compare
…y` deps config This commit updates the logic that calculates `useFactory` function arguments to avoid relying on `instanceof` checks (thus always retaining symbols) and relies on flags that DI decorators contain (as a monkey-patched property). Another perf benefit is having less megamorphic reads while calculating args for the `useFactory` call: we used to check whether a token has `ngMetadataName` property 4 times (in worst case), now we have just 1 megamorphic read in all cases. Closes angular#40143.
5e2e5bd
to
b4de94a
Compare
@@ -838,11 +838,11 @@ export declare interface RendererType2 { | |||
} | |||
|
|||
export declare class ResolvedReflectiveFactory { | |||
dependencies: ɵangular_packages_core_core_d[]; | |||
dependencies: ɵangular_packages_core_core_e[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for public-api
group reviewers: this change is a noop from public API perspective, this change is likely a result of some symbol reordering in generated bundle (since new logic was added as a part of this PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
Merge assistance: please change the target label to "target: rc" if this PR is merged after v11.1.0-rc.0 is released (so that this change makes it into v11.1.0). Thank you. |
…y` deps config (#40145) This commit updates the logic that calculates `useFactory` function arguments to avoid relying on `instanceof` checks (thus always retaining symbols) and relies on flags that DI decorators contain (as a monkey-patched property). Another perf benefit is having less megamorphic reads while calculating args for the `useFactory` call: we used to check whether a token has `ngMetadataName` property 4 times (in worst case), now we have just 1 megamorphic read in all cases. Closes #40143. PR Close #40145
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit updates the logic that calculates
useFactory
function arguments to avoid relying oninstanceof
checks (thus always retaining symbols) and relies on flags that DI decorators contain (as a monkey-patched property).
Another perf benefit is having less megamorphic reads while calculating args for the
useFactory
call: we used tocheck whether a token has
ngMetadataName
property 4 times (in worst case), now we have just 1 megamorphic read inall cases.
Closes #40143.
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?