Skip to content

queue up timeouts to prevent each ellipsis from starting rootScope digest cycles - #42

Merged
MauMaGau merged 1 commit into
dibari:masterfrom
sod:single-digest
Sep 30, 2015
Merged

MauMaGau merged 1 commit into
dibari:masterfrom
sod:single-digest

Conversation

@sod

@sod sod commented Sep 30, 2015

Copy link
Copy Markdown
Contributor

This is a performance improvement PR

Each ellipsis on the page starts its own $digest on every resize|ng-bind|ng-bind-html. This slows down the page - especially on ng-repeat use. The bigger your app, the harder the impact, as every single watcher becomes invoked on each digest cycle.

This PR fixes this by queing up consecutive checks and calls them in a single $digest.

Performance gain: On my page I use ellipsis in a paginated list of 24 items. A digest cycle takes ~4 ms. So the ng-repeat => ellipsis impact goes down 24 fold from ~100ms to ~4ms.

@sod sod changed the title queue up timeouts to prevent each elipsis from starting the root digest cycle queue up timeouts to prevent each ellipsis from starting rootScope digest cycles Sep 30, 2015
MauMaGau added a commit that referenced this pull request Sep 30, 2015
queue up timeouts to prevent each ellipsis from starting rootScope digest cycles
@MauMaGau
MauMaGau merged commit e42888d into dibari:master Sep 30, 2015
This was referenced Mar 7, 2016
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