Changeset 143137 in webkit
- Timestamp:
- Feb 17, 2013 3:26:10 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143136 r143137 1 2013-02-17 Andreas Kling <akling@apple.com> 2 3 REGRESSION(r143125): ~5% performance hit on Chromium's intl2 page cycler. 4 <http://webkit.org/b/108835> 5 6 Reviewed by Ojan Vafai. 7 8 Streamline the case where GlyphPage has a per-glyph SimpleFontData* lookup table to allow 9 taking earlier branches on pages with lots of mixed-font text. 10 We accomplish this by explicitly storing a null SimpleFontData* for glyph #0 in the per-glyph 11 lookup table instead of relying on "if (!glyph)" checks in getters. 12 13 This is a speculative optimization, I can't get stable enough numbers locally to tell if this 14 will resolve the issue on the bots. 15 16 * platform/graphics/GlyphPage.h: 17 (WebCore::GlyphPage::glyphDataForIndex): 18 (WebCore::GlyphPage::fontDataForCharacter): 19 (WebCore::GlyphPage::setGlyphDataForIndex): 20 1 21 2013-02-17 Chris Fleizach <cfleizach@apple.com> 2 22 -
trunk/Source/WebCore/platform/graphics/GlyphPage.h
r143125 r143137 104 104 ASSERT_WITH_SECURITY_IMPLICATION(index < size); 105 105 Glyph glyph = m_glyphs[index]; 106 if (m_perGlyphFontData) 107 return GlyphData(glyph, m_perGlyphFontData[index]); 106 108 if (!glyph) 107 109 return GlyphData(0, 0); 108 if (m_perGlyphFontData)109 return GlyphData(glyph, m_perGlyphFontData[index]);110 110 return GlyphData(glyph, m_fontDataForAllGlyphs); 111 111 } … … 119 119 const SimpleFontData* fontDataForCharacter(UChar32 c) const 120 120 { 121 return glyphDataForIndex(indexForCharacter(c)).fontData; 121 unsigned index = indexForCharacter(c); 122 if (m_perGlyphFontData) 123 return m_perGlyphFontData[index]; 124 Glyph glyph = m_glyphs[index]; 125 if (!glyph) 126 return 0; 127 return m_fontDataForAllGlyphs; 122 128 } 123 129 … … 132 138 m_glyphs[index] = glyph; 133 139 134 // GlyphPage getters will always return a null SimpleFontData* for glyph #0, so don't worry about the pointer for them. 140 // GlyphPage getters will always return a null SimpleFontData* for glyph #0 if there's no per-glyph font array. 141 if (m_perGlyphFontData) { 142 m_perGlyphFontData[index] = glyph ? fontData : 0; 143 return; 144 } 145 135 146 if (!glyph) 136 147 return; … … 138 149 // A glyph index without a font data pointer makes no sense. 139 150 ASSERT(fontData); 140 141 if (m_perGlyphFontData) {142 m_perGlyphFontData[index] = fontData;143 return;144 }145 151 146 152 if (!m_fontDataForAllGlyphs) … … 154 160 m_perGlyphFontData = static_cast<const SimpleFontData**>(fastMalloc(size * sizeof(SimpleFontData*))); 155 161 for (unsigned i = 0; i < size; ++i) 156 m_perGlyphFontData[i] = oldFontData;162 m_perGlyphFontData[i] = m_glyphs[i] ? oldFontData : 0; 157 163 m_perGlyphFontData[index] = fontData; 158 164 }
Note: See TracChangeset
for help on using the changeset viewer.