Changeset 235162 in webkit


Ignore:
Timestamp:
Aug 22, 2018 12:01:16 AM (6 years ago)
Author:
Carlos Garcia Campos
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r235159 r235162  
     12018-08-22  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Do not try to update the compositing policy when not in accelerated compositing mode
     4        https://bugs.webkit.org/show_bug.cgi?id=188787
     5
     6        Reviewed by Simon Fraser.
     7
     8        RenderLayerCompositor::updateCompositingPolicy() is called very often (called from
     9        RenderLayerCompositor::cacheAcceleratedCompositingFlags()) and it uses WTF::memoryFootprint() to decide the
     10        current compositing policy. Getting the memory footprint is an expensive operation in Linux (and I suspect other
     11        non-cocoa ports too), causing an excessive CPU usage. This caused the WPE and GTK+ unit test
     12        /webkit/WebKitWebContext/uri-scheme to start timing out in the bots, because the test expects things to happen
     13        fast and that's no longer the case. We could reduce the CPU usage a lot by not trying to update the policy when
     14        not in accelerated compositing mode. We will need a solution for the accelerated compositing mode, though.
     15
     16        Fixes WPE/GTK+ unit test /webkit/WebKitWebContext/uri-scheme.
     17
     18        * rendering/RenderLayerCompositor.cpp:
     19        (WebCore::RenderLayerCompositor::updateCompositingPolicy): Return early when not in accelerated compositing mode.
     20
    1212018-08-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
    222
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r234768 r235162  
    369369bool RenderLayerCompositor::updateCompositingPolicy()
    370370{
     371    if (!inCompositingMode())
     372        return false;
     373
    371374    auto currentPolicy = m_compositingPolicy;
    372375    if (page().compositingPolicyOverride()) {
Note: See TracChangeset for help on using the changeset viewer.