More performance optimization for text-autospace
Categories
(Core :: Layout: Text and Fonts, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox145 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
(Whiteboard: [jp-mvp])
Attachments
(3 external files)
As noted in bug 1987997 comment 8, svg-text-textLength-1.html can cause perf_reftest_singletons talos test suites time out intermittently on Linux, which is blocking enabling text-autospace on Nightly.
The performance regression occurs after bug 1986837. Specifically, the 8-bit text optimization is removed in Bug 1986837 patch 2, and determining the autospace in the preceding content takes more time.
| Assignee | ||
Comment 1•1 year ago
|
||
valueOr() unconditionally evaluates its parameter, so we should use
valueOrFrom() to call findPrecedingClass() only when needed.
See the documentation:
https://searchfox.org/firefox-main/rev/36ebbdf6fbbfd0b40a607212ec843992b5d43e92/mfbt/Maybe.h#504-509
With layout.css.text-autospace.enabled=true, on my local Linux machine, the
running time of
testing/talos/talos/tests/perf-reftest-singletons/svg-text-textLength-1.html
drops from 29,425ms to 22,279ms (~24% faster).
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
If word-spacing is zero, we don't need to call IsCSSWordSpacingSpace() at
all.
With layout.css.text-autospace.enabled=true, on my local Linux machine, the
the running time of
testing/talos/talos/tests/perf-reftest-singletons/svg-text-textLength-1.html
drops from 22,279 ms to 19,274 ms (~13% faster).
| Assignee | ||
Comment 3•1 year ago
|
||
The second and subsequent characters cannot be ideographs in a 1-byte text.
With layout.css.text-autospace.enabled=true, on my local Linux machine, the
running time of
testing/talos/talos/tests/perf-reftest-singletons/svg-text-textLength-1.html
drops from 19,274 ms to 13,052 ms (~32% faster).
| Assignee | ||
Comment 4•1 year ago
|
||
Here's a performance comparison for perf_reftest_singletons on Windows (base = text-autospace enabled, new = text-autospace enabled + the patches in this bug).
The two subtests most impacted by text-autospace show substantial gains:
bidi-resolution-1.html: ~15% improvementsvg-text-textLength-1.html: ~42% improvement
Comment 5•1 year ago
|
||
The optimizations here are great, thank you! Hopefully this will let us turn on the pref for wider testing without further problems.
Updated•1 year ago
|
Comment 7•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/fc4ef6354775
https://hg.mozilla.org/mozilla-central/rev/97f05001d655
https://hg.mozilla.org/mozilla-central/rev/6c63924355bd
Updated•1 year ago
|
Description
•