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

App startup lag around linkDynamicModule #8724

Closed
zackarychapple opened this issue May 19, 2016 · 5 comments
Closed

App startup lag around linkDynamicModule #8724

zackarychapple opened this issue May 19, 2016 · 5 comments

Comments

@zackarychapple
Copy link
Contributor

zackarychapple commented May 19, 2016

Using RC0 and the AngularCLI I have generated a project and after working on it for a while I performed a prod build in the CLI and tested the deploy of the project. I noticed there is an almost 1 second delay from the point at which my main.js and index.js files are retrieved and my first component is pulled down.

Here is my bootstrap.
bootstrap(WfaNg2AppComponent, [ ROUTER_PROVIDERS, provide(LocationStrategy, { useClass: HashLocationStrategy }) ]);

Here is the network tab during the bootstrap.
screen shot 2016-05-19 at 8 48 08 am

Here is the timeline for that period of wait.
screen shot 2016-05-19 at 8 42 41 am

If I turn off hash location strategy here is my network.
screen shot 2016-05-19 at 9 27 28 am

Here is the timeline with the hash location strategy off.
screen shot 2016-05-19 at 9 29 19 am

@sod
Copy link
Contributor

sod commented May 19, 2016

Module loader performance in general is very disappointing if you throw the angular modular structure against it. I guess thats the reason why the bundles where removed in rc.0

At the moment the team experiments with http://rollupjs.org/. A module bundler that can get rid of the module syntax alltogether and removes unused methods in the process.

@robwormald has a test repository https://github.com/robwormald/ng2-compiler-test2 that spawned from ng-conf. The build there is just 50kb gzipped and loads very fast. I hope he writes a blog about it or we get a rollup guide like the webpack one on https://angular.io/docs/ts/latest/guide/webpack.html

@zackarychapple
Copy link
Contributor Author

Thats good information, I remember that talk well, the performance was fantastic. I use the CLI though so I'm not quite ready to change the build strategy just yet.

@IgorMinar
Copy link
Contributor

the AOT compilation and squashing modules via rollup addresses this problem. CLI will have these features enabled by default in the future releases. In the meantime it's possible to set these up via your own build pipeline.

@zackarychapple
Copy link
Contributor Author

zackarychapple commented Oct 4, 2016

@IgorMinar looks like it's in the current build 1.0.0-beta.16 of the CLI. angular/angular-cli#1732 (comment) Thank you again for helping to make sure this got fixed.

@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 Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants