Matched declaration cache currently restores the non-inherted properties from the cache entry but still applies all inherited properties normally. In case the current parent inherited style is equivalent to the cache entry's, also the inherited style can be reused and no properties need to be applied. This is faster and saves memory (by sharing the style structures more).
Created attachment 117167 [details] patch
Loading the HTML5 spec this reduces style memory consumption by ~20% (5MB, ~2.5% of the total) and speeds up the style applying by ~25% for ~0.4s (2-3%) gain in the benchmark.
Comment on attachment 117167 [details] patch cq+!!!!!!111!!!1!!!
Comment on attachment 117167 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=117167&action=review > Source/WebCore/rendering/style/RenderStyle.cpp:332 > + && inherited.get() == other->inherited.get() > +#if ENABLE(SVG) > + && m_svgStyle.get() == other->m_svgStyle.get() > +#endif > + && rareInheritedData.get() == other->rareInheritedData.get(); I’m surprised these get() calls were needed. You typically can compare smart pointers without an explicit get() call.
(In reply to comment #3) > (From update of attachment 117167 [details]) > cq+!!!!!!111!!!1!!! Oh no!!!11
http://trac.webkit.org/changeset/101524
> I’m surprised these get() calls were needed. You typically can compare smart pointers without an explicit get() call. These smart pointers are bit special (some very early khtml code too).
Specifically DataRef::operator== compares the objects for equality rather than just the pointers (which is what I want here for performance reasons).