Reduce the number of created elements in TextPropertyEditor
Categories
(DevTools :: Inspector: Rules, task)
Tracking
(firefox143 fixed)
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(1 file)
In TextPropertyEditor, we're creating all the elements that we might need and hide them if we don't: https://searchfox.org/mozilla-central/rev/86878e73a24fe32ea09dbae5b55362efaf7485c8/devtools/client/inspector/rules/views/text-property-editor.js#102,168,211,215,243,247,249,256,258,261,263,266,270,274,287,289,293,295
class TextPropertyEditor {
...
#create() {
...
this.expander = createChild(this.container, "button", {
...
});
...
this.warning = createChild(this.container, "div", {
...
});
...
this.invalidAtComputedValueTimeWarning = createChild(
...
);
...
this.unusedState = createChild(this.container, "div", {
...
});
...
this.compatibilityState = createChild(this.container, "div", {
...
});
...
this.filterProperty = createChild(this.container, "button", {
...
});
...
this.computed = createChild(this.element, "ul", {
...
});
...
this.shorthandOverridden = createChild(this.element, "ul", {
...
});
It's quite likely that those different elements won't ever be visible for the majority of declarations, and on elements with lots of declarations, this can impact the time spent in styling and reflow (see https://share.firefox.dev/3GSxfE0 , populating the rules view with a lot of declarations, 30% of the time is spent in Layout)
| Assignee | ||
Comment 1•2 months ago
|
||
We used to create elements that we would hide by default, and show them when
we needed them (expander, warning icon, compatibility issue, unusued icon,
invalid at computed value time, computed items, shorthand items).
This increased the time spend in styling for no real benefit, so in this path
we only create those elements once we would display them for the first time.
Updated•2 months ago
|
Updated•2 months ago
|
Backed out for causing dt failures
| Assignee | ||
Updated•2 months ago
|
Comment 6•2 months ago
|
||
| bugherder | ||
Comment 7•2 months ago
|
||
(In reply to Serban Stanca [:SerbanS] from comment #6)
Perfherder has detected a devtools performance change from push ff53ed6b567f30f993c3ed6dc1ee1cb1ca922027.
If you have any questions, please reach out to a performance sheriff. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.
Improvements:
| Ratio | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|
| 10% | damp custom.inspector.manycssvariables.selectnode | linux1804-64-shippable-qr | e10s fission stylo webrender | 311.19 -> 279.24 |
| 10% | damp custom.inspector.manyrules.deselectnode | linux1804-64-shippable-qr | e10s fission stylo webrender | 146.56 -> 132.20 |
| 10% | damp complicated.jsdebugger.open.DAMP | linux1804-64-shippable-qr | e10s fission stylo webrender | 660.91 -> 596.40 |
| 6% | damp browser-toolbox.webconsole-ready.DAMP | windows11-64-24h2-shippable | e10s fission stylo webrender | 416.36 -> 389.98 |
| 5% | damp custom.inspector.manyrules.selectnode | linux1804-64-shippable-qr | e10s fission stylo webrender | 822.76 -> 777.66 |
| 5% | damp browser-toolbox.webconsole-ready.DAMP | linux1804-64-shippable-qr | e10s fission stylo webrender | 670.29 -> 634.03 |
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a performance sheriff to do that for you.
You can run all of these tests on try with ./mach try perf --alert 46239
The following documentation link provides more information about this command.
Updated•2 months ago
|
Description
•