Skip to content

perf(core): avoid pulling in jit-specific code in aot bundles#37372

Closed
crisbeto wants to merge 1 commit into
angular:masterfrom
crisbeto:FW-2193/compiler-facade-aot
Closed

perf(core): avoid pulling in jit-specific code in aot bundles#37372
crisbeto wants to merge 1 commit into
angular:masterfrom
crisbeto:FW-2193/compiler-facade-aot

Conversation

@crisbeto

@crisbeto crisbeto commented Jun 1, 2020

Copy link
Copy Markdown
Member

In #29083 a call to getCompilerFacade was added to ApplicationRef which pulls in a bit of JIT-specific code. Since the code path that calls the function can't be hit for an AOT-compiled app, these changes add an ngJitMode guard which will allow for dead code elimination to drop it completely. Testing it out against a new CLI project showed a difference of ~1.2kb.

@crisbeto crisbeto force-pushed the FW-2193/compiler-facade-aot branch 3 times, most recently from 4974c11 to e0c1ae7 Compare June 1, 2020 08:21
@crisbeto crisbeto added area: core Issues related to the framework runtime core: performance labels Jun 1, 2020
@ngbot ngbot Bot added this to the needsTriage milestone Jun 1, 2020
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jun 1, 2020
@crisbeto crisbeto marked this pull request as ready for review June 1, 2020 08:42
@pullapprove pullapprove Bot requested review from IgorMinar and mhevery June 1, 2020 08:42
Comment thread packages/core/src/application_ref.ts Outdated
@crisbeto crisbeto force-pushed the FW-2193/compiler-facade-aot branch 3 times, most recently from dd27312 to 1039cae Compare June 4, 2020 17:02

@JoostK JoostK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💯

@IgorMinar IgorMinar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thank you!

Reviewed-for: global-approvers

Comment thread goldens/size-tracking/integration-payloads.json Outdated
@crisbeto crisbeto force-pushed the FW-2193/compiler-facade-aot branch from 1039cae to 165e02d Compare June 9, 2020 15:23
In angular#29083 a call to `getCompilerFacade` was added to `ApplicationRef` which pulls in a bit of JIT-specific code. Since the code path that calls the function can't be hit for an AOT-compiled app, these changes add an `ngJitMode` guard which will allow for dead code elimination to drop it completely. Testing it out against a new CLI project showed a difference of ~1.2kb.
@crisbeto crisbeto force-pushed the FW-2193/compiler-facade-aot branch from 165e02d to c5c5ee3 Compare June 9, 2020 15:40
@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Jun 9, 2020
@atscott atscott added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Jun 9, 2020
@atscott

atscott commented Jun 9, 2020

Copy link
Copy Markdown
Contributor

@crisbeto As discussed, switching this to master only as there are conflicts with the patch branch. Please create a follow-up for patch only

@atscott atscott closed this in b2ccc34 Jun 9, 2020
crisbeto added a commit to crisbeto/angular that referenced this pull request Jun 9, 2020
…r#37372)

In angular#29083 a call to `getCompilerFacade` was added to `ApplicationRef` which pulls in a bit of JIT-specific code. Since the code path that calls the function can't be hit for an AOT-compiled app, these changes add an `ngJitMode` guard which will allow for dead code elimination to drop it completely. Testing it out against a new CLI project showed a difference of ~1.2kb.

PR Close angular#37372
atscott pushed a commit that referenced this pull request Jun 9, 2020
#37514)

In #29083 a call to `getCompilerFacade` was added to `ApplicationRef` which pulls in a bit of JIT-specific code. Since the code path that calls the function can't be hit for an AOT-compiled app, these changes add an `ngJitMode` guard which will allow for dead code elimination to drop it completely. Testing it out against a new CLI project showed a difference of ~1.2kb.

PR Close #37372

PR Close #37514
ngwattcos pushed a commit to ngwattcos/angular that referenced this pull request Jun 25, 2020
…r#37372)

In angular#29083 a call to `getCompilerFacade` was added to `ApplicationRef` which pulls in a bit of JIT-specific code. Since the code path that calls the function can't be hit for an AOT-compiled app, these changes add an `ngJitMode` guard which will allow for dead code elimination to drop it completely. Testing it out against a new CLI project showed a difference of ~1.2kb.

PR Close angular#37372
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Jul 10, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
…r#37372)

In angular#29083 a call to `getCompilerFacade` was added to `ApplicationRef` which pulls in a bit of JIT-specific code. Since the code path that calls the function can't be hit for an AOT-compiled app, these changes add an `ngJitMode` guard which will allow for dead code elimination to drop it completely. Testing it out against a new CLI project showed a difference of ~1.2kb.

PR Close angular#37372
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 cla: yes core: performance target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants