Qt World Summit: Submit your Presentation

Qt bad drawing performance

  • Hello ,

    I have a question about the drawing performance differences between macOS and Windows. In my application I have some animated widgets (dynamically drawn in the paint event) that needs to be redrawn at least 30 times a second. I noticed a very big difference in cpu usage between Windows and macOS, with macOS using around 25% of my CPU and that is not an acceptable resource consumption for my simple application.

    • Is the raster-engine really that much worse on macOS?
    • Will this improve with the metal implementation in Qt 6?
    • Is there any way to speed up the rendering if I have multiple animated widgets in my application?

    I profiled it and most time was spent in QBackingStore flush and it seems to be a constant bottleneck.

    I also tried to use QGLWidget and QOpenGLWidget with the QPainter, but they are not scaling as well as standard QWidget.

    Here is an example project with some animated widgets as a showcase: https://ufile.io/78fg3ne1

    I'm using Qt 5.15.1 and tried Qt 5.14.2 and Qt 6 preview also with no performance difference.
    Also take as a note, that my Windows laptop is way less powerful than my MacBook. The cpu usages down there are from the example application.

    MacBook Pro 2019
    macOS 10.15.7
    2,6 GHz 6-Core Intel Core i7
    CPU usage: around 12-15%

    Dell XPS 9530 (from 2014)
    Windows 10 (2004)
    2,3 GHz 4-Core Intel Core i7 (4712HQ)
    CPU usage: around 6-8%