WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2009-05-06 22:06:04 PDT
<
rdar://problem/6864062
>
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
http://trac.webkit.org/changeset/43364
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug