Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-59701

QWidget::update() performance regression macOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.8.0, 5.9.0 Beta 1, 5.9.0 Beta 2
    • Fix Version/s: None
    • Component/s: QPA
    • Labels:
      None
    • Environment:
      masOS 10.11.6, retina screen
    • Platform/s:
      macOS

      Description

      Our application triggers an update() on a canvas type QWidget whenever the mouse moves (to show a preview of vector drawing tools).

      In Qt <= 5.7, the delay between calling update() and the actual paintEvent() was about 30ms in average, 40ms max.

      In Qt >=5.8, the delay between calling update() and the actual paintEvent() degrades when the user keeps moving the mouse and ends up being about 45ms in average with maximums of 135ms. That's more than 0.1s between calling update and a paintEvent which is a very noticeable performance degradation.

      Attached is a minimalistic example that in a very simplistic way mimics what our application does: trigger an update when the mouse moves. The delay between calling update() and the triggered paintEvent() is measured and average and maximum are output (in ms) when the application is terminated.

        Attachments

        1. performance.pro
          0.2 kB
        2. mainwindow.h
          0.4 kB
        3. mainwindow.cpp
          0.9 kB
        4. main.cpp
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            drew Drew
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes