-
Notifications
You must be signed in to change notification settings - Fork 27.5k
chore(Scope): short-circuit after dirty-checking last dirty watcher #5287
Conversation
Stop dirty-checking during $digest after the last dirty watcher has been re-checked. This prevents unneeded re-checking of the remaining watchers (They were already checked in the previous iteration), bringing a substantial performance improvement to the average case run time of $digest. Closes angular#5272
Thanks for the PR!
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
@kseamon please review this PR. I've modified your commit slightly and added tests. |
I guess this assumes that the watch functions themselves (as opposed to watch handlers) are in fact idempotent and have no side-effects? |
LGTM |
@pete - It does, but the old behavior did as well. If we couldn't assume that the watch value functions were without side-effects then we'd have to iterate forever. |
I guess this was always an assumption but it could have been possible for a
|
@kseamon Sure. I'm in favor of that. |
Hi |
All righty. You should probably file a separate ticket for this, but the simple solution is to clear the lastDirtyWatch variable whenever an unwatch call is made. Sent from my iPhone
|
opened issue on this |
Stop dirty-checking during $digest after the last dirty watcher has been re-checked. This prevents unneeded re-checking of the remaining watchers (They were already checked in the previous iteration), bringing a substantial performance improvement to the average case run time of $digest. Closes angular#5272 Closes angular#5287
Stop dirty-checking during $digest after the last dirty watcher has been re-checked. This prevents unneeded re-checking of the remaining watchers (They were already checked in the previous iteration), bringing a substantial performance improvement to the average case run time of $digest. Closes angular#5272 Closes angular#5287
Stop dirty-checking during $digest after the last dirty watcher has been re-checked.
This prevents unneeded re-checking of the remaining watchers (They were already checked in the previous iteration), bringing a substantial performance improvement to the average case run time of $digest.
Closes #5272