Closed Bug 1090301 Opened 10 years ago Closed 10 years ago

Reduce number of Angular watchers even more & switch to one-time binding where possible

Categories

(Tree Management :: Treeherder, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: camd)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

49 bytes, text/x-github-pull-request
emorley
: review+
Details | Review
Continuing on from bug 1069389, we should try to reduce the number of watchers even more. Now that we're using Angular 1.3, we can use one-time binding: https://docs.angularjs.org/guide/expression#one-time-binding I also found a tip for cases where the value does update occasionally (and as such we can't use one-time binding), but fully binding is excessive - see end of: https://medium.com/@kentcdodds/angularjs-one-time-bindings-and-recompiling-templates-9857b2cead01 Also for a quick way to analyse the current number of watchers, see: https://medium.com/@kentcdodds/counting-angularjs-watchers-11c5134dc2ef
Assignee: nobody → cdawson
Status: NEW → ASSIGNED
Commit pushed to master at https://github.com/mozilla/treeherder-ui https://github.com/mozilla/treeherder-ui/commit/601cc19fc9957702055b916c6acd1a87867d61d7 Revert "Bug 1090301 - replace ng-bind with bind-once" This reverts commit a7cf4908b25e8655fab7cad53ecce245ad9fc54c.
Attached file PR 261
Attachment #8519043 - Flags: review?(emorley)
Attachment #8519043 - Flags: review?(emorley) → review+
This has been merged in. I suspect we will have to do more passes on things like this. It may become possible to reduce the number of watchers further. There still seems like a lot. These changes took the watchers from ~750 down to ~500. Some watchers are good and useful; that's part of AngularJS's strength. But hard to say what the right number should be.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
In: https://github.com/mozilla/treeherder-ui/blob/master/webapp/app/partials/main/thWatchedRepoInfoDropDown.html We have: <a href="https://treestatus.mozilla.org/{{treeStatus}}" target="_blank">tree status</a> and: <a href="https://secure.pub.build.mozilla.org/clobberer/?branch={{::name}}" target="_blank">clobberer</a> Is there a reason why the latter can use one-time binding and not the former?
Flags: needinfo?(cdawson)
Yeah, that one should be fine with one-way binding, too. I just missed it. Good catch! You up for fixing that?
Flags: needinfo?(cdawson)
(In reply to Cameron Dawson [:camd] from comment #8) > Yeah, that one should be fine with one-way binding, too. I just missed it. > Good catch! You up for fixing that? Sure; bug 1099146 :-)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: