Closed
Bug 1471584
Opened 6 years ago
Closed 6 years ago
Avoid using a virtual call within gfxHarfBuzzShaper::HBGetGlyphHAdvance
Categories
(Core :: Graphics: Text, enhancement, P3)
Core
Graphics: Text
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
Details
Attachments
(1 file)
1.92 KB,
patch
|
lsalzman
:
review+
|
Details | Diff | Splinter Review |
This is a very hot function when doing text layout -- it's called for every glyph the shaper processes. Currently, it calls the gfxFont's ProvidesGlyphWidths() method, which is a virtual function, to determine which implementation to use. We should avoid that. The result of ProvidesGlyphWidths() is already cached in the shaper object, so by just checking that flag instead we can avoid the virtual call here in the inner loop of text shaping. (The perf benefit will be lost in the noise for normal cases, but with an extreme testcase that involves shaping multiple megabytes of text, I'm measuring a definite improvement in total reflow time, from ~6200ms to ~5950ms.)
Assignee | ||
Comment 1•6 years ago
|
||
Attachment #8988151 -
Flags: review?(lsalzman)
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Updated•6 years ago
|
Attachment #8988151 -
Flags: review?(lsalzman) → review+
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/1b9dcb1b80dd Micro-optimize text shaping by avoiding an unnecessary virtual method call. r=lsalzman
Comment 3•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1b9dcb1b80dd
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•