gfxTextRun::SortGlyphRuns may be inefficient
Categories
(Core :: Graphics: Text, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(1 file)
In some cases, gfxTextRun::SortGlyphRuns ends up finding numerous GlyphRun records that can be coalesced with their neighbors; but the use of nsTArray::RemoveElementAt(index) to remove the redundant ones individually becomes inefficient if the array is large, and multiple removals are needed, as each operation will move all the following elements.
We have nsTArray::RemoveElementsBy(predicate) to do this more efficiently as a single pass over the array, so we should adapt SortGlyphRuns to use this.
Assignee | ||
Comment 1•2 years ago
|
||
In the patches for bug 1823215, we eliminated the use of a local copy of the glyph runs array
during SortGlyphRuns; but we call RemoveElementAt individually for each run to be coalesced,
which means potentially moving all the rest of the array multiple times. Instrumentation shows
that we sometimes end up with dozens of glyphruns to be coalesced (or even hundreds/thousands,
in pathological cases), which becomes quite inefficient.
Using RemoveElementsBy(predicate) instead will minimize the copying/moving of the remaining
array elements.
Updated•2 years ago
|
Updated•2 years ago
|
Comment 3•2 years ago
|
||
bugherder |
Description
•