Skip to content

Several performance updates to the Angular 1 version #2

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lgalfaso
Copy link

@lgalfaso lgalfaso commented Mar 8, 2015

Added several performance fixes to the Angular 1 version

@djsmith42
Copy link
Owner

Thanks for looking into the performance of this demo.

Your most significant change is the localApply = false for the call to $timeout with a local digest. I specifically chose not to do that for this demo because this was meant to simulate an AJAX request with $http, which does not provide a localApply feature.

This demo was meant to be representative of Angular apps in general, which are usually not designed to keep track of which scopes changed, because Angular 1 encourages global digest.

TL;DR As you show, Angular 1 is not inherently slow. This demo, along with virtually any Angular 1 app, could be optimized to be fast, but app developers would have to depart from idiomatic Angular code to do so.

@djsmith42
Copy link
Owner

@lgalfaso Also, did you see any improvement to the initial load speed with these changes? I do not.

@lgalfaso
Copy link
Author

lgalfaso commented Mar 9, 2015 via email

@djsmith42
Copy link
Owner

Agreed on all points.

This demo showed two things:

  1. Initial DOM loading in Angular 1 is slow.
  2. Global digests are slow.

I think it showed those points well enough, and while there are good solutions for #2, there are basically no solutions for #1 to my knowledge. Do you know of any?

@lgalfaso
Copy link
Author

lgalfaso commented Mar 9, 2015 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants