Title: [96512] trunk/Source/WebCore
Revision
96512
Author
[email protected]
Date
2011-10-03 09:50:53 -0700 (Mon, 03 Oct 2011)

Log Message

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

Patch by Andreas Kling <[email protected]> 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96511 => 96512)


--- trunk/Source/WebCore/ChangeLog	2011-10-03 16:36:46 UTC (rev 96511)
+++ trunk/Source/WebCore/ChangeLog	2011-10-03 16:50:53 UTC (rev 96512)
@@ -1,3 +1,19 @@
+2011-10-03  Andreas Kling  <[email protected]>
+
+        FontFallbackList: Glyph pages waste a lot of memory.
+        https://bugs.webkit.org/show_bug.cgi?id=69260
+
+        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:
+
 2011-10-03  Konstantin Scheglov  <[email protected]>
 
         Right border missing from table with colspan and collapsing border

Modified: trunk/Source/WebCore/platform/graphics/FontFallbackList.h (96511 => 96512)


--- trunk/Source/WebCore/platform/graphics/FontFallbackList.h	2011-10-03 16:36:46 UTC (rev 96511)
+++ trunk/Source/WebCore/platform/graphics/FontFallbackList.h	2011-10-03 16:50:53 UTC (rev 96512)
@@ -53,7 +53,10 @@
     FontSelector* fontSelector() const { return m_fontSelector.get(); }
     unsigned generation() const { return m_generation; }
 
-    typedef HashMap<int, GlyphPageTreeNode*> GlyphPages;
+    struct GlyphPagesHashTraits : HashTraits<int> {
+        static const int minimumTableSize = 16;
+    };
+    typedef HashMap<int, GlyphPageTreeNode*, DefaultHash<int>::Hash, GlyphPagesHashTraits> GlyphPages;
     GlyphPageTreeNode* glyphPageZero() const { return m_pageZero; }
     const GlyphPages& glyphPages() const { return m_pages; }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to