Cannot draw a single rectangle at constant 60fps
-
I was curious about the fps performance versus element type so I wrote a simple test program to display a number of elements (Canvas, QuickPaintedItem, QNanoPainter, QuickItem...)...
Doing this, I experienced that drawing a single Rectangle was not always showing a 60fps : when window is getting large enough (more than 2000x2000), the fps suddenly drops to 35-40 fps.
In addition, It happens in rare occasion I could reach full screen dimension (3840x2160) with a steady 60fps.Tested with Debian bullseye, Qt5.15.2, Nvidia GeForce GTX 1060 6GB
Here is the QML document for a single Rectangle :
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.2 Window { id:window width: 640 height: 480 onWidthChanged: console.log("width : " + width ) onHeightChanged: console.log("height : " + height ) visible: true title: qsTr("Test FPS") Rectangle{ anchors.fill:parent color:"red" Control{ id: fpsMeter property int frameCounter: 0 property int frameCounterAvg: 0 property int counter: 0 property real fps: 0 property real fpsAvg: 0 implicitWidth :100 implicitHeight:20 Item { anchors.fill: parent NumberAnimation on rotation { from:0; to: 360; duration: 800; loops: Animation.Infinite } onRotationChanged: fpsMeter.frameCounter++; } Label { anchors.fill: parent text: "Ø " + fpsMeter.fpsAvg.toFixed(1) + " | " + fpsMeter.fps.toFixed(1) + " fps" } Timer { interval: 1000; repeat: true; running: true onTriggered: { fpsMeter.frameCounterAvg += fpsMeter.frameCounter; fpsMeter.fps = fpsMeter.frameCounter / interval * 1000; fpsMeter.counter++; fpsMeter.frameCounter = 0; if (fpsMeter.counter >= 10) { fpsMeter.fpsAvg = fpsMeter.frameCounterAvg/(interval / 1000 * fpsMeter.counter) fpsMeter.frameCounterAvg = 0; fpsMeter.counter = 0; } } } } } }
Do you have feedbacks about known limitations/issues or simply things I could do wrong (I have tried to analyse it with qml profiler but without finding the potential bottleneck) ?