Closed
Bug 1360620
Opened 7 years ago
Closed 7 years ago
Reduce size of gfxTextRun by optimizing glyphrun storage
Categories
(Core :: Graphics: Text, enhancement)
Core
Graphics: Text
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(1 file)
See https://dxr.mozilla.org/mozilla-central/rev/2cca333f546f38860f84940d4c72d7470a3410f4/gfx/thebes/gfxTextRun.h#760-762. I propose to reduce the size of gfxTextRun by replacing the AutoTArray<GlyphRun,1> (32 bytes in a 64-bit build) with a union that holds either a single GlyphRun *or* an nsTArray<GlyphRun>, with a flag elsewhere in gfxTextRun to record which is currently present (we have a spare padding byte available for that). There will be a bit of overhead in AddGlyphRun when transitioning from a single glyphrun (stored inline) to two glyphruns (in an array), but that will be essentially equivalent to the work AutoTArray does when its autobuffer oveflows. This should reduce the size of gfxTextRun by 16 bytes, yet have the same allocation behavior as at present: when there's a single GlyphRun, it is stored directly in the textrun with no separate heap allocation, and when there are multiple glyph runs, we have to allocate heap storage for the array (just as the autoarray does when its one-element buffer overflows).
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Assignee | ||
Updated•7 years ago
|
Attachment #8862944 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 2•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=cc9944ab7313793b0873a53271a1376eac550adb
Updated•7 years ago
|
Attachment #8862944 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 3•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/dca52e4ed76197ec3e3629e659020c3d5c8d81bb Bug 1360620 - Optimize GlyphRun storage strategy in gfxTextRun, to reduce the overall size of the gfxTextRun object. r=jrmuizel
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/dca52e4ed761 Optimize GlyphRun storage strategy in gfxTextRun, to reduce the overall size of the gfxTextRun object. r=jrmuizel
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dca52e4ed761
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•