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

framerate dropped from 900 to 50 when switching from 5.0.2 to 5.1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.2.0
    • 5.1.0
    • Core: Other
    • None
    • windows 7
    • Qt 5 : 882e01a94f83bc1625d68b279cdde9a38dae0166 , 54f1d7e2e48b896755aa930ee7e4ecacf51bf977

    Description

      Hi,
      My application (3D viewer) is using a QTimer with a delay of 1ms, which trigger an update, which cause window to be repainted (and the 3D scene to be rendered).

      I used to have a timer of 0ms, but I have came accross some big issue: application freezing, docked widget not responding anymore when moved, etc...
      The only way of solving the issue, was to:

      • set the timer as a single shot with 1ms delay
      • at the end of the "paintEvent(QPaintEvent *event)" method (i.e. the method that indirectly gets called when the timer event is triggered), manually start the timer again with a 1ms delay (single shot)

      I think this is related to the issue as well: https://bugreports.qt-project.org/browse/QTBUG-29435 - this all comes down to the event dispatcher on windows I think (although my experience with Qt internals is quite limited).

      Now, back to this issue: I switched to Qt 5.1.0, since that my framerate dropped to 50/60 FPS (instead of 900 FPS for an empty scene), i.e. the timer resolution seems to have dropped to 15/20 ms instead of 1ms.

      I am using Windows 7, and noticed the following change in "qeventdispatcher_win.cpp":

      if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) { // QTBUG-27266, Disable when running MSVC2012-built code on pre-Windows 8

      So basically, there is no way to use a high-precision timer in Qt anymore ?
      I think there is a real problem in the event dispatcher, this issue simply being a side effect. Getting rid of the high precision timer is a hack rather than a real solution (with many side effect as the frame rate drop I am experiencing here) - switching back to 5.0.2...

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-32257
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              gjaegy Gregory Jaegy
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes