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)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: camd)
References
(Blocks 1 open bug)
Details
(Keywords: perf)
Attachments
(1 file)
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 | ||
Updated•10 years ago
|
Assignee: nobody → cdawson
Status: NEW → ASSIGNED
Comment 2•10 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder-ui
https://github.com/mozilla/treeherder-ui/commit/a7cf4908b25e8655fab7cad53ecce245ad9fc54c
Bug 1090301 - replace ng-bind with bind-once
Comment 3•10 years ago
|
||
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.
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8519043 -
Flags: review?(emorley)
Reporter | ||
Updated•10 years ago
|
Attachment #8519043 -
Flags: review?(emorley) → review+
Comment 5•10 years ago
|
||
Commits pushed to master at https://github.com/mozilla/treeherder-ui
https://github.com/mozilla/treeherder-ui/commit/e6da34f4e04f380abd09e555254c5d2b0a94fd01
bug 1090301 - restore revert of {{ }} to use :: bind once
https://github.com/mozilla/treeherder-ui/commit/40b5c7fcc6180748b4b5cb4611b25abfc56aadda
bug 1090301 - restore removal of sheriff check
https://github.com/mozilla/treeherder-ui/commit/0ba64359b7806804109b28386ae881623f6a6f52
Merge pull request #261 from mozilla/one-way-bind
bug 1090301 - change {{ }} to use :: - bind once
Assignee | ||
Comment 6•10 years ago
|
||
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
Reporter | ||
Comment 7•10 years ago
|
||
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)
Assignee | ||
Comment 8•10 years ago
|
||
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)
Reporter | ||
Comment 9•10 years ago
|
||
(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 :-)
Comment 10•10 years ago
|
||
Commits pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/d438a2848e3c7f88b0883e0f18909bc9e3879e15
Bug 1090301 - replace ng-bind with bind-once
https://github.com/mozilla/treeherder/commit/3b63c1a453847ee0d8bb3c6a43b803cc963eaffb
Revert "Bug 1090301 - replace ng-bind with bind-once"
This reverts commit a7cf4908b25e8655fab7cad53ecce245ad9fc54c.
https://github.com/mozilla/treeherder/commit/0274fa6d34a2b5f376fc2d391c607c3b57999953
bug 1090301 - restore revert of {{ }} to use :: bind once
https://github.com/mozilla/treeherder/commit/1b1e5096ba04f1f41fbb2a6dcad803d1af0ca017
bug 1090301 - restore removal of sheriff check
https://github.com/mozilla/treeherder/commit/67ebcd599232f706e117f619cdc33fed637f8e83
Merge pull request #261 from mozilla/one-way-bind
bug 1090301 - change {{ }} to use :: - bind once
You need to log in
before you can comment on or make changes to this bug.
Description
•