<html>
    <head>
      <base href="https://bugzilla.gnome.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - GTK+ uses a lot more CPU under Wayland than under X11"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=772075">772075</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>GTK+ uses a lot more CPU under Wayland than under X11
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Platform
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>gtk+
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.21.x
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: Wayland
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>gtk-bugs@gtk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gns@gnome.org
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>gtk-bugs@gtk.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>rob@robster.org.uk, wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>GNOME version</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When I run gtk3-demo --run=pixbufs on my Gnome on Wayland session I get around
86% CPU usage. If I run it with GDK_BACKEND=x11 it uses only around 25%.

Perf tells me the biggest offender is
bits_image_fetch_bilinear_affine_normal_a8. Setting a breakpoint in gdb I
noticed it is almost all due to gtk_window_draw drawing client-side
decorations, particularly shadows.

Returning at the top of that function after just chaining up to the parent
brings CPU usage down to ~42%. Still higher than under Xwayland, but much lower
than the original 86%.

This is the biggest drag on the WebKitGTK+ performance at the moment, I
believe. While playing a 4k video the browser spends most of its time painting
the window decoration.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>