Closed
Bug 555435
Opened 16 years ago
Closed 16 years ago
reduce memory overhead of preloading cmaps
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jfkthame, Assigned: jfkthame)
Details
Attachments
(1 file)
|
1.48 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
We preload the font cmap table into a gfxSparseBitSet in each font entry, for use in font fallback. Because gfxSparseBitSet uses nsTArray<> to manage its collection of Blocks, it will typically over-allocate array capacity during construction as the array grows.
However, as these arrays are never modified after the initial reading of the cmap, any residual over-allocation at that time represents permanently-wasted space.
I checked on my Mac with a fairly modest collection of fonts installed (around 200 families), and the total over-capacity of the cmap block arrays was around 800K. For a user with a very large number of fonts, it would be correspondingly greater.
We can reclaim this memory by simply calling Compact() on the block arrays after each cmap is loaded.
| Assignee | ||
Comment 1•16 years ago
|
||
Assignee: nobody → jfkthame
Attachment #435370 -
Flags: review?(jdaggett)
Updated•16 years ago
|
Attachment #435370 -
Flags: review?(jdaggett) → review+
| Assignee | ||
Comment 2•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•