WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
23050
Copying Fonts by value makes GraphicsContext::save() and restore() expensive
https://bugs.webkit.org/show_bug.cgi?id=23050
Summary
Copying Fonts by value makes GraphicsContext::save() and restore() expensive
Simon Fraser (smfr)
Reported
2008-12-30 22:12:19 PST
I have a Shark sample (generated from the testcase in
bug 19312
) that shows that GraphicsContext::save() and restore() are pretty expensive; in this test. they take 11.7% and 23% of the entire sample (of which 87% is in painting). Focusing on GraphicsContext::restore(), GraphicsContext::operator= is 65%, including 58% from Font::operator=. Vector::removeLast is 19%, and restorePlatformState() is 14%. Of the Font::operator= cost, almost all is in the GlyphPageTreeNode hash table copy. Inside GraphicsContext::save(), 62% is in the Font constructor, and 22% is savePlatformState.
Attachments
Shark session
(2.47 MB, application/octet-stream)
2009-01-01 19:08 PST
,
Simon Fraser (smfr)
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2009-01-01 19:07:21 PST
Testcase in the URL field.
Simon Fraser (smfr)
Comment 2
2009-01-01 19:08:45 PST
Created
attachment 26358
[details]
Shark session
Simon Fraser (smfr)
Comment 3
2009-01-01 19:10:36 PST
My initial analysis was done on a debug build (stupid!). In a release build, things aren't nearly as bad. In the attached Shark profile of the testcase, GraphicsContext::restore() is 1.4%, and GraphicsContext::save() 0.6%. However, Font::operator= is still 39% of the time spent in GraphicsContext::restore(), so I think there's still a win to be had here.
Simon Fraser (smfr)
Comment 4
2009-01-01 19:27:44 PST
Another good testcase:
http://www.bel.fi/~alankila/plasma.html
Simon Fraser (smfr)
Comment 5
2009-01-17 18:29:05 PST
Obviated by
http://trac.webkit.org/changeset/40007
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