Closed Bug 1095141 Opened 10 years ago Closed 9 years ago

Use $rootScope.$emit in preference to $rootScope.$broadcast where possible

Categories

(Tree Management :: Treeherder, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mdoglio, Assigned: mdoglio)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

As outlined in [1] broadcasting an event from the root scope performs much worse than using an emit.
Here [2] is a discussion about it

[1]http://jsperf.com/rootscope-emit-vs-rootscope-broadcast/
[2]http://stackoverflow.com/a/19498009/288703
Assignee: nobody → mdoglio
Status: NEW → ASSIGNED
Priority: -- → P1
Blocks: 1067846
Commits pushed to master at https://github.com/mozilla/treeherder-ui

https://github.com/mozilla/treeherder-ui/commit/88cca5cfe377a4eec0183ba1d1511834957833cb
Bug 1095141 - Use $rootScope.$emit in preference to

$rootScope.$broadcast where possible

https://github.com/mozilla/treeherder-ui/commit/fdf226fe8c75eeb5c82858b11a430a2e858c4784
Merge pull request #262 from mozilla/bug-1095141-stop-using-broadcast

Bug 1095141 - Use $rootScope.$emit in preference to
Keywords: perf
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Reopening this to remove a couple of $rootScope.$broadcast calls here:
https://github.com/mozilla/treeherder-ui/blob/new-structured-log-viewer/webapp/app/js/controllers/main.js#L93-L104
and their $scope.$on counterpart here:
https://github.com/mozilla/treeherder-ui/blob/1d81a9ceb67518688711de30e7d5e4326896c59e/webapp/app/js/directives/main.js#L24

They can be safely replaced with a $rootScope.$emit() and $rootScope.$on()
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Priority: P1 → P2
No longer blocks: treeherder-dev-transition
Assignee: mdoglio → nobody
Commits pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/7907a9133fb1c1c468964eefd0ec4852625aeaca
Bug 1095141 - Use $rootScope.$emit in preference to

$rootScope.$broadcast where possible

https://github.com/mozilla/treeherder/commit/2b0eb5c6fe3b3c12d08734a75d61c7cf8fbf8382
Merge pull request #262 from mozilla/bug-1095141-stop-using-broadcast

Bug 1095141 - Use $rootScope.$emit in preference to
Blocks: 1170103
I've broken out the remaining parts to bug 1170103.
Assignee: nobody → mdoglio
Status: REOPENED → RESOLVED
Closed: 10 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.