RESOLVED FIXED 25605
Reduce the size of GlyphPage
https://bugs.webkit.org/show_bug.cgi?id=25605
Summary Reduce the size of GlyphPage
Simon Fraser (smfr)
Reported 2009-05-06 22:04:40 PDT
GlyphPage wastes a lot of space with padding, because it has a 256-size array of GlyphData, which is { unsigned short, pointer }. In 64-bit, that's 6 bytes of padding.
Attachments
Patch, changelog (12.07 KB, patch)
2009-05-06 22:12 PDT, Simon Fraser (smfr)
darin: review+
Simon Fraser (smfr)
Comment 1 2009-05-06 22:06:04 PDT
Simon Fraser (smfr)
Comment 2 2009-05-06 22:12:12 PDT
Created attachment 30086 [details] Patch, changelog
Darin Adler
Comment 3 2009-05-07 10:02:31 PDT
Comment on attachment 30086 [details] Patch, changelog How did you test the performance impact of this change?
Simon Fraser (smfr)
Comment 4 2009-05-07 10:41:23 PDT
I'm going to run PLTs today.
Simon Fraser (smfr)
Comment 5 2009-05-07 12:56:12 PDT
PLTs show this is a small perf gain (0.25%).
Darin Adler
Comment 6 2009-05-07 13:54:25 PDT
Comment on attachment 30086 [details] Patch, changelog > + GlyphData() > + : glyph(0) > + , fontData(0) > + { > + } > + GlyphData(Glyph g, const SimpleFontData* f) > + : glyph(g) > + , fontData(f) > + { > + } Could just write the above as one constructor with default arguments: GlyphData(Glyph g = 0, const SimpleFontData* f = 0) instead. > + memcpy(m_glyphs, other.m_glyphs, GlyphPage::size * sizeof(m_glyphs[0])); > + memcpy(m_glyphFontData, other.m_glyphFontData, GlyphPage::size * sizeof(m_glyphFontData[0])); This is in a member of GlyphPage, so you can omit the GlyphPage:: from the use of size. In fact, you should just use sizeof(m_glyphs) and sizeof(m_glyphFontData). > + memset(m_glyphs, 0, GlyphPage::size * sizeof(m_glyphs[0])); > + memset(m_glyphFontData, 0, GlyphPage::size * sizeof(m_glyphFontData[0])); Ditto. r=me
Simon Fraser (smfr)
Comment 7 2009-05-07 14:11:09 PDT
Note You need to log in before you can comment on or make changes to this bug.