Skip to content
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): speed up retrieval of DestroyRef in EventEmitter #54748

Closed
wants to merge 1 commit into from

Conversation

devversion
Copy link
Member

Speeds up the retrieval of DestroyRef in EventEmitter because try/catch is expensive if
there is no injection context.

We saw a script time regression in Cloud.

@pkozlowski-opensource pkozlowski-opensource added area: core Issues related to the framework runtime target: rc This PR is targeted for the next release-candidate labels Mar 7, 2024
@ngbot ngbot bot added this to the Backlog milestone Mar 7, 2024
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM, one non-blocking comment

packages/core/src/di/contextual.ts Outdated Show resolved Hide resolved
@devversion devversion added the action: global presubmit The PR is in need of a google3 global presubmit label Mar 7, 2024
@devversion
Copy link
Member Author

Passing TGP

@devversion devversion added action: merge The PR is ready for merge by the caretaker and removed action: global presubmit The PR is in need of a google3 global presubmit labels Mar 8, 2024
alxhub
alxhub previously requested changes Mar 9, 2024
packages/core/src/di/contextual.ts Outdated Show resolved Hide resolved
Speeds up the retrieval of `DestroyRef` in `EventEmitter` because
`try/catch` is expensive if there is no injection context.

We saw a script time regression in Cloud.

The goldens had to be updated because `getInjectImplementation` is now
referenced. `inject` also references the underlying field, but directly.
This is super minimal overhead of a function exposing the internal
field.
@devversion devversion dismissed alxhub’s stale review March 11, 2024 11:56

Addressed feedback; unblocking

@devversion
Copy link
Member Author

devversion commented Mar 11, 2024

Caretaker note: Pre-existing failures— fixed via #54791

@devversion devversion added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Mar 11, 2024
@atscott
Copy link
Contributor

atscott commented Mar 11, 2024

This PR was merged into the repository by commit 142825d.

atscott pushed a commit that referenced this pull request Mar 11, 2024
)

Speeds up the retrieval of `DestroyRef` in `EventEmitter` because
`try/catch` is expensive if there is no injection context.

We saw a script time regression in Cloud.

The goldens had to be updated because `getInjectImplementation` is now
referenced. `inject` also references the underlying field, but directly.
This is super minimal overhead of a function exposing the internal
field.

PR Close #54748
@atscott atscott closed this in 142825d Mar 11, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants