-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Digest cycles initiated by the grid #5007
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
Comments
If all the unit tests work and all of the tutorials work, then I see nothing but positives for this change. You want to submit a PR? |
csvan
added a commit
to csvan/ui-grid
that referenced
this issue
Nov 23, 2016
Angular's $timeout takes a boolean 3rd parameter which causes the wrapped function to not run inside $apply. Since $timeout is used extensively in scope, this parameter has been passed where possible in order to improve performance, since the grid otherwise triggers a large number of digests while functioning normally. See issue: angular-ui#5007
@YonatanKra #5829 just got merged, if you are happy with the changes maybe this can be closed. |
mportuga
pushed a commit
that referenced
this issue
Mar 22, 2017
Part 1: Reduce digest cylces in ui-grid-utils #5007
mportuga
pushed a commit
that referenced
this issue
Mar 22, 2017
Part 1: Reduce digest cylces in ui-grid-utils #5007
mportuga
pushed a commit
that referenced
this issue
Mar 24, 2017
mportuga
pushed a commit
that referenced
this issue
Mar 24, 2017
vishalnarewade
pushed a commit
to vishalnarewade/ui-grid
that referenced
this issue
Nov 6, 2017
Part 1: Reduce digest cylces in ui-grid-utils angular-ui#5007
vishalnarewade
pushed a commit
to vishalnarewade/ui-grid
that referenced
this issue
Nov 6, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are way too many digest cycles for the grid load/rendering. I've managed to reduce the load by setting some of the
$timeout
s to$timeout(method, 0, false)
. I've managed to reduce the number by 2/3 this way, with no seeming side effects (and my app now loads much faster - I have around 9-10 grids on one page, that can open side menus with more, so this is critical...).I've created a plnkr that shows that every load, you get roughly 35 digest cycles - with no extra feature involved:
http://plnkr.co/edit/uOYKeJvANJu1b9zk8Ac1?p=catalogue (it also shows that the grid increases the number of digests each time it reloads which might indicate a memory leak, but then again, it might be just the demo app).
For instnace:
ui-grid/src/js/core/directives/ui-grid.js
Line 244 in 1dc9931
init is being called iniside a
$timeout
. It then callsgrid.refreshCanvas
which in turn does another$timeout
(ui-grid/src/js/core/factories/Grid.js
Line 2121 in a1e6a04
As I said, I've managed to reduce this number of cycles with the method above. Is there a special reason why there are so many
$timeout
s inside the core code?The text was updated successfully, but these errors were encountered: