Changeset 96512 in webkit


Ignore:
Timestamp:
Oct 3, 2011 9:50:53 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

FontFallbackList: Glyph pages waste a lot of memory.
https://bugs.webkit.org/show_bug.cgi?id=69260

Patch by Andreas Kling <kling@webkit.org> on 2011-10-03
Reviewed by Dan Bernstein.

Use a minimum hash table size of 16 (down from 64) for FontFallbackList's
glyph pages. This reduces memory consumption by ~900 kB when loading the
full HTML5 spec.

The cost is two additional rehash()es of FontFallbackList::m_pages when
adding the 32nd and 64th pages to the hash map.

  • platform/graphics/FontFallbackList.h:
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96509 r96512  
     12011-10-03  Andreas Kling  <kling@webkit.org>
     2
     3        FontFallbackList: Glyph pages waste a lot of memory.
     4        https://bugs.webkit.org/show_bug.cgi?id=69260
     5
     6        Reviewed by Dan Bernstein.
     7
     8        Use a minimum hash table size of 16 (down from 64) for FontFallbackList's
     9        glyph pages. This reduces memory consumption by ~900 kB when loading the
     10        full HTML5 spec.
     11
     12        The cost is two additional rehash()es of FontFallbackList::m_pages when
     13        adding the 32nd and 64th pages to the hash map.
     14
     15        * platform/graphics/FontFallbackList.h:
     16
    1172011-10-03  Konstantin Scheglov  <scheglov@google.com>
    218
  • trunk/Source/WebCore/platform/graphics/FontFallbackList.h

    r96342 r96512  
    5454    unsigned generation() const { return m_generation; }
    5555
    56     typedef HashMap<int, GlyphPageTreeNode*> GlyphPages;
     56    struct GlyphPagesHashTraits : HashTraits<int> {
     57        static const int minimumTableSize = 16;
     58    };
     59    typedef HashMap<int, GlyphPageTreeNode*, DefaultHash<int>::Hash, GlyphPagesHashTraits> GlyphPages;
    5760    GlyphPageTreeNode* glyphPageZero() const { return m_pageZero; }
    5861    const GlyphPages& glyphPages() const { return m_pages; }
Note: See TracChangeset for help on using the changeset viewer.