Skip to content

Instantly share code, notes, and snippets.

@octplane
Created December 2, 2013 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save octplane/7751877 to your computer and use it in GitHub Desktop.
Save octplane/7751877 to your computer and use it in GitHub Desktop.
diff --git a/src/vendor/angular/angular.js b/src/vendor/angular/angular.js
index d2115fe..e878eae 100644
--- a/src/vendor/angular/angular.js
+++ b/src/vendor/angular/angular.js
@@ -8779,6 +8779,9 @@ function $RootScopeProvider(){
logIdx, logMsg;
beginPhase('$digest');
+ var ccount = 0;
+ console.time("$digest");
+
do { // "while dirty" loop
dirty = false;
@@ -8796,6 +8799,7 @@ function $RootScopeProvider(){
if ((watchers = current.$$watchers)) {
// process our watches
length = watchers.length;
+ ccount += length;
while (length--) {
try {
watch = watchers[length];
@@ -8842,6 +8846,8 @@ function $RootScopeProvider(){
}
} while (dirty || asyncQueue.length);
+ console.timeEnd("$digest");
+ console.log("%d watchers", ccount);
clearPhase();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment