WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
76460
Perf improvement via caching Element::styleForRenderer()
https://bugs.webkit.org/show_bug.cgi?id=76460
Summary
Perf improvement via caching Element::styleForRenderer()
Peter Kotwicz
Reported
2012-01-17 08:36:18 PST
styleForRenderer() is a pretty heavy function. In some cases we compute it twice in "Element::recalcStyle" and "NodeRendererFactory::createRendererIfNeeded". NdeRendererFactory is called via Element::attach I have attached a file where this improvement does improve the performance of Element::recalc. For the attached file, the improvement is on the order of 3-4us. On measurements on a reasonably complex page, doing the caching results in a .1 - .5ms improvement in processing Element::recalc
Attachments
test case
(192 bytes, text/html)
2012-01-17 11:07 PST
,
Peter Kotwicz
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2012-01-17 10:54:45 PST
I'm planning to get rid of NodeRenderingFactory class which just confuses things. Computing the style twice in case of attach() triggered from recalcStyle is indeed a problem that should be fixed.
Peter Kotwicz
Comment 2
2012-01-17 11:07:20 PST
Created
attachment 122784
[details]
test case
Peter Kotwicz
Comment 3
2012-01-17 13:00:51 PST
I did a bit more measurements. For a reasonable web site, for a page where the recalc is done twice, this produces a performance improvement in Element::recalcStyle of about 1%
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