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

High CPU usage with animations on macOS desktop and iOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.2, 6.5.1, 6.6.0
    • None
    • iOS/tvOS/watchOS, macOS

    Description

      Qt applications have a lot of CPU usage on macOS and iOS when playing simple animations.

      Consider this demo app:

      import QtQuick
      
      Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Animation test")
      
        Rectangle {
          width: 100
          height: 100
          anchors.centerIn: parent
          color: "red"
          visible: true
      
          PropertyAnimation on rotation {
            from: 0
            to: 360
            duration: 1000
            loops: Animation.Infinite
            running: true
          }
        }
      }

      Gets about 10%+ CPU usage on macOS and 20%+ when running in iOS simulator. More complex apps have even more CPU load until it becomes too much and UI starts lagging.

      I would expect something this simple to have <1% usage instead. This is the case on other platforms (tested Windows desktop and Android).

      Note: the CPU usage goes away if the animation is not running, or if the application window is not visible (eg. behind other windows). It does not go away if the Rectangle is set to visible: false however.

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            Chrisu Christian Bartsch
            Votes:
            10 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes