Bug 69260 - FontFallbackList: Glyph pages waste a lot of memory.
Summary: FontFallbackList: Glyph pages waste a lot of memory.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
Depends on:
Reported: 2011-10-03 08:21 PDT by Andreas Kling
Modified: 2011-10-03 09:50 PDT (History)
3 users (show)

See Also:

Proposed patch (1.69 KB, patch)
2011-10-03 08:25 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2011-10-03 08:21:36 PDT
The m_pages hash map in FontFallbackList is defined as follows:

typedef HashMap<int, GlyphPageTreeNode*> GlyphPages;
GlyphPages m_pages;

This uses the default HashMap minimum table size of 64 buckets which is quite wasteful in many cases.

One idea is to lower the minimum table size using hash traits. A patch will follow that lowers it to 16, which reduces memory consumption by ~900 kB when loading the full HTML5 spec.
Comment 1 Andreas Kling 2011-10-03 08:25:23 PDT
Created attachment 109486 [details]
Proposed patch
Comment 2 WebKit Review Bot 2011-10-03 09:50:00 PDT
Comment on attachment 109486 [details]
Proposed patch

Clearing flags on attachment: 109486

Committed r96512: <http://trac.webkit.org/changeset/96512>
Comment 3 WebKit Review Bot 2011-10-03 09:50:04 PDT
All reviewed patches have been landed.  Closing bug.