Title: [209862] trunk/Source
Revision
209862
Author
[email protected]
Date
2016-12-15 07:46:13 -0800 (Thu, 15 Dec 2016)

Log Message

[CSS Parser] Enable CSS Deferred Parsing
https://bugs.webkit.org/show_bug.cgi?id=165869

Reviewed by Sam Weinig.

Source/WebCore:

Enable CSS deferred parsing once again. It's now behind a pref,
so it's easy to flip off and on.

To address the memory regression that caused the previous rollout,
the tokenizer is no longer retained. Instead the sheet text and escaped
strings are retained by CSSDeferredParser, and then DeferredStyleProperties
and DeferredStyleGroupRuleList make copies of the tokens from the original
tokenization process. As the rules get parsed, these tokens get thrown
away.

This means that instead of the entire set of tokens staying in memory
as long as even one unparsed rule remained, now only the tokens that
still need parsing will remain alive.

Unparsed rules will consume slightly more memory than parsed rules, but
the more unparsed rules you have, the bigger the performance win as
well, so this is a tradeoff. Given that the parsing speed is going up
by anywhere from 25-40% on cold loads of pages (where all stylesheets
have to parse), this seems worth it to me.

* css/parser/CSSParserMode.h:
* page/Settings.in:

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209861 => 209862)


--- trunk/Source/WebCore/ChangeLog	2016-12-15 13:47:57 UTC (rev 209861)
+++ trunk/Source/WebCore/ChangeLog	2016-12-15 15:46:13 UTC (rev 209862)
@@ -1,3 +1,33 @@
+2016-12-15  Dave Hyatt  <[email protected]>
+
+        [CSS Parser] Enable CSS Deferred Parsing
+        https://bugs.webkit.org/show_bug.cgi?id=165869
+
+        Reviewed by Sam Weinig.
+
+        Enable CSS deferred parsing once again. It's now behind a pref,
+        so it's easy to flip off and on.
+
+        To address the memory regression that caused the previous rollout,
+        the tokenizer is no longer retained. Instead the sheet text and escaped
+        strings are retained by CSSDeferredParser, and then DeferredStyleProperties
+        and DeferredStyleGroupRuleList make copies of the tokens from the original
+        tokenization process. As the rules get parsed, these tokens get thrown
+        away.
+
+        This means that instead of the entire set of tokens staying in memory
+        as long as even one unparsed rule remained, now only the tokens that
+        still need parsing will remain alive.
+
+        Unparsed rules will consume slightly more memory than parsed rules, but
+        the more unparsed rules you have, the bigger the performance win as
+        well, so this is a tradeoff. Given that the parsing speed is going up
+        by anywhere from 25-40% on cold loads of pages (where all stylesheets
+        have to parse), this seems worth it to me.
+
+        * css/parser/CSSParserMode.h:
+        * page/Settings.in:
+
 2016-12-15  Alejandro G. Castro  <[email protected]>
 
         [OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html

Modified: trunk/Source/WebCore/css/parser/CSSParserMode.h (209861 => 209862)


--- trunk/Source/WebCore/css/parser/CSSParserMode.h	2016-12-15 13:47:57 UTC (rev 209861)
+++ trunk/Source/WebCore/css/parser/CSSParserMode.h	2016-12-15 15:46:13 UTC (rev 209862)
@@ -107,7 +107,7 @@
     bool useLegacyBackgroundSizeShorthandBehavior { false };
     bool springTimingFunctionEnabled { false };
     
-    bool deferredCSSParserEnabled { false };
+    bool deferredCSSParserEnabled { true };
 
     URL completeURL(const String& url) const
     {

Modified: trunk/Source/WebCore/page/Settings.in (209861 => 209862)


--- trunk/Source/WebCore/page/Settings.in	2016-12-15 13:47:57 UTC (rev 209861)
+++ trunk/Source/WebCore/page/Settings.in	2016-12-15 15:46:13 UTC (rev 209862)
@@ -249,7 +249,7 @@
 
 newBlockInsideInlineModelEnabled initial=false, setNeedsStyleRecalcInAllFrames=1
 
-deferredCSSParserEnabled initial=false
+deferredCSSParserEnabled initial=true
 
 httpEquivEnabled initial=true
 

Modified: trunk/Source/WebKit2/ChangeLog (209861 => 209862)


--- trunk/Source/WebKit2/ChangeLog	2016-12-15 13:47:57 UTC (rev 209861)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-15 15:46:13 UTC (rev 209862)
@@ -1,3 +1,12 @@
+2016-12-15  Dave Hyatt  <[email protected]>
+
+        [CSS Parser] Enable CSS Deferred Parsing
+        https://bugs.webkit.org/show_bug.cgi?id=165869
+
+        Reviewed by Sam Weinig.
+
+        * Shared/WebPreferencesDefinitions.h:
+
 2016-12-14  Andreas Kling  <[email protected]>
 
         Only send Messages::WebPageProxy::DidSaveToPageCache once when entering page cache.

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (209861 => 209862)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-12-15 13:47:57 UTC (rev 209861)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-12-15 15:46:13 UTC (rev 209862)
@@ -229,7 +229,7 @@
     macro(EnableInheritURIQueryComponent, enableInheritURIQueryComponent, Bool, bool, false, "", "") \
     macro(ServiceControlsEnabled, serviceControlsEnabled, Bool, bool, false, "", "") \
     macro(NewBlockInsideInlineModelEnabled, newBlockInsideInlineModelEnabled, Bool, bool, false, "", "") \
-    macro(DeferredCSSParserEnabled, deferredCSSParserEnabled, Bool, bool, false, "", "") \
+    macro(DeferredCSSParserEnabled, deferredCSSParserEnabled, Bool, bool, true, "", "") \
     macro(HTTPEquivEnabled, httpEquivEnabled, Bool, bool, true, "", "") \
     macro(MockCaptureDevicesEnabled, mockCaptureDevicesEnabled, Bool, bool, false, "", "") \
     macro(MediaCaptureRequiresSecureConnection, mediaCaptureRequiresSecureConnection, Bool, bool, true, "", "") \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to