DescriptionReduce the number of CachedUAStyles
CachedUAStyles are large (160b) and not cheap to create because they
include several Length objects which have non-trivial destructors,
making CachedUAStyles expensive to destruct. This patch reduces the
number of CachedUAStyles by only creating them when needed.
There are two changes in this patch:
1) CachedUAStyle& is no longer a member on StyleAdjuster but is
instead passed in through StyleAdjuster::adjustRenderStyle.
2) The cached UA style is now constructed as-needed in
StyleResolverState::cacheUserAgentBorderAndBackground.
StyleResolverState always owned the CachedUAStyle but this patch
makes it explicit by changing the type to OwnPtr<CachedUAStyle>. A
null check was needed in RenderTheme::adjustStyle but otherwise
CachedUAStyle was not accessed without being set.
Before patch:
facebook.com - 19,850 CachedUAStyles constructed
wikipedia cat - 22,686 CachedUAStyles constructed
With patch:
facebook.com - 538 CachedUAStyles constructed
wikipedia cat - 16 CachedUAStyles constructed
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176163
Patch Set 1 #Patch Set 2 : Ownptrization and a null check #
Total comments: 2
Patch Set 3 : Return a create that somehow escaped #
Messages
Total messages: 8 (0 generated)
|