Optimize bidi resolution where possible
Categories
(Core :: Layout: Text and Fonts, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox125 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(2 files)
Profiling and reading the nsBidiPresUtils code, I've noticed some minor inefficiencies that we can improve; patches incoming.
| Assignee | ||
Comment 1•2 years ago
|
||
We don't need to explicitly drop bidi-control frames from the original list in BidiLineData,
and make the corresponding updates to the Levels and IndexMap arrays; instead, we can just
skip over them when building the VisualFrames array.
Also, in nsBidiPresUtils::ReorderFrames we don't need a BidiLineData at all if there's only
a single frame on the line; we can just call RepositionFrame directly.
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
In nsBidiPresUtils::ResolveParagraph, we replace any block or segment separators
with space characters before bidi resolution. The use of nsString::ReplaceChar
here can appear in profiles, so it seems worth having a custom accelerated version
to handle the fixed set of separator codes. My local testing indicates this runs
between 5 and 10 times faster than the general-purpose function that has to
iterate over the provided set of characters at runtime.
| Assignee | ||
Updated•2 years ago
|
Comment 4•2 years ago
|
||
Backed out for causing build bustage on nsBidiPresUtils.cpp
| Assignee | ||
Updated•2 years ago
|
Comment 6•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/cb08b842d8fd
https://hg.mozilla.org/mozilla-central/rev/300643546ea8
Description
•