-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
In your pub/sub model you are broadcasting on the root scope, which bubbles down through every scope in the app (it's easy to have hundreds) looking for listeners.
You can achieve the same architecture with much better performance by using $rootScope.emit(...) rather than $rootScope.broadcast(....) On the listening side you'll need to change $scope.on(...) to $rootScope.on(...)
In my app the performance different was fairly huge in UI responsiveness, to the extent that I couldn't achieve my design until I made this modification.
See here for an explanation of avoiding .broadcast: http://stackoverflow.com/a/19498009/288703
and here for some quantification of the performance difference:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels