question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NGC rebuild performance improvements (Ivy & AoT)

See original GitHub issue

šŸš€ feature request

Relevant Package

This feature request is for @angular/compiler-cli

Description

Thanks to the team my issue https://github.com/angular/angular/issues/33986 was fixed in 9rc4 build. I open this feature request to ask (prioritize) others impovements regarding ngc rebuild, actually in large project 8-15s rebuild (on each file change) is pretty long.

Repro

I think I succeed to repro a rebuild slowness by multiply by 2 the number of components (now 817) in my last issue repro ng-speed-rebuild Clone master branch, create ngcc ivy entry points, run npm run ngc to start the project. Here’s ngc-9rc9.cpuprofile of an isolated rebuild of the repro.

Describe the solution you’d like

Out of scope to me. From what I’ve learned/heard the long phase is: emitting and reparse all components on each rebuild

Describe alternatives you’ve considered

  1. I tried on two differents hardware (VM ubuntu & win10) rebuild time is pretty same.
  2. I can’t be sure if ng-speed-rebuild repro is reflecting our private project because we have a lot of imports/exports/shared components. On our private project we have 850 components, if it can help here you are a .cpuprofile of an isolated ngc rebuild of our private project private-project-ngc-9rc9.cpuprofile
  3. NOTE: With CLI 9rc9 ng serve rebuild is weird and really longer https://github.com/elvisbegovic/ng-speed-rebuild#ng-serve-9rc9-rebuild--83s---7s---5s---15s---17s---14s

Other

Might be related to https://github.com/angular/angular/issues/34796 (wait repro)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
alxhubcommented, Jan 24, 2020

@elvisbegovic thank you so much for the reproduction! These kinds of examples are invaluable in diagnosing performance issues. I’ve already found a couple interesting issues from this repo:

  1. The way we implement template type-checking triggers ā€œsafe modulesā€ reuse in TypeScript, which is slower than ā€œcompleteā€ program reuse. I have an idea for how to avoid this, which I’ll play around with.

  2. In this repo, during incremental build steps TypeScript does reports that a number of .d.ts files have changed between builds (obviously this isn’t the case). This causes us to deopt and not reuse any parts of Angular analysis or previous emit results. It’s a huge performance hit and is only marginally faster than a full fresh build. Ouch.

  3. The dependency graph seems to require the re-emit of all the components when the one you suggested is changed anyway. This seems excessive, and I need to dig into why the graph is shaped as such. Perhaps there’s room for improvement here.

I’ll dig into these. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

All About Angular Engine Ivy in 5 mins
The build and rebuild time enhancement in Ivy, empowers AOT to offer an improved developer experience. In Angular 9, AOT compilation is enabledĀ ......
Read more >
A look at major features in the Angular Ivy version 9 release
With the build and rebuild time improvements in Ivy, AOT-compilation now has a great developer experience. When we used JIT compilation inĀ ...
Read more >
Ivy Rendering Engine | Sherman Digital
More efficiently rebuilding components contributes significantly to Ivy's improved compilation times. When compiling components, ViewEngineĀ ...
Read more >
Improving Build Speed & Bundle Size with Angular Ivy | #ngconf
Join GrapeCity & ng-conf for this webinar on all the benefits that come with using the Ivy compiler. Walk away knowing how to...
Read more >
How do I enable Ivy for Angular 8 or 9? - Stack Overflow
you can auto upgrade ... AOT compilation with Ivy is faster and should be used by default. ... To stop using the Ivy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found