Title: [235162] trunk/Source/WebCore
Revision
235162
Author
carlo...@webkit.org
Date
2018-08-22 00:01:16 -0700 (Wed, 22 Aug 2018)

Log Message

Do not try to update the compositing policy when not in accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=188787

Reviewed by Simon Fraser.

RenderLayerCompositor::updateCompositingPolicy() is called very often (called from
RenderLayerCompositor::cacheAcceleratedCompositingFlags()) and it uses WTF::memoryFootprint() to decide the
current compositing policy. Getting the memory footprint is an expensive operation in Linux (and I suspect other
non-cocoa ports too), causing an excessive CPU usage. This caused the WPE and GTK+ unit test
/webkit/WebKitWebContext/uri-scheme to start timing out in the bots, because the test expects things to happen
fast and that's no longer the case. We could reduce the CPU usage a lot by not trying to update the policy when
not in accelerated compositing mode. We will need a solution for the accelerated compositing mode, though.

Fixes WPE/GTK+ unit test /webkit/WebKitWebContext/uri-scheme.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingPolicy): Return early when not in accelerated compositing mode.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (235161 => 235162)


--- trunk/Source/WebCore/ChangeLog	2018-08-22 05:05:08 UTC (rev 235161)
+++ trunk/Source/WebCore/ChangeLog	2018-08-22 07:01:16 UTC (rev 235162)
@@ -1,3 +1,23 @@
+2018-08-22  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        Do not try to update the compositing policy when not in accelerated compositing mode
+        https://bugs.webkit.org/show_bug.cgi?id=188787
+
+        Reviewed by Simon Fraser.
+
+        RenderLayerCompositor::updateCompositingPolicy() is called very often (called from
+        RenderLayerCompositor::cacheAcceleratedCompositingFlags()) and it uses WTF::memoryFootprint() to decide the
+        current compositing policy. Getting the memory footprint is an expensive operation in Linux (and I suspect other
+        non-cocoa ports too), causing an excessive CPU usage. This caused the WPE and GTK+ unit test
+        /webkit/WebKitWebContext/uri-scheme to start timing out in the bots, because the test expects things to happen
+        fast and that's no longer the case. We could reduce the CPU usage a lot by not trying to update the policy when
+        not in accelerated compositing mode. We will need a solution for the accelerated compositing mode, though.
+
+        Fixes WPE/GTK+ unit test /webkit/WebKitWebContext/uri-scheme.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateCompositingPolicy): Return early when not in accelerated compositing mode.
+
 2018-08-21  Yusuke Suzuki  <yusukesuz...@slowstart.org>
 
         Support "name" option for dedicated workers

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (235161 => 235162)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2018-08-22 05:05:08 UTC (rev 235161)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2018-08-22 07:01:16 UTC (rev 235162)
@@ -368,6 +368,9 @@
 
 bool RenderLayerCompositor::updateCompositingPolicy()
 {
+    if (!inCompositingMode())
+        return false;
+
     auto currentPolicy = m_compositingPolicy;
     if (page().compositingPolicyOverride()) {
         m_compositingPolicy = page().compositingPolicyOverride().value();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to