vinoth kumar
vinoth kumar

Reputation: 313

FPS for QtQuick 1 and QtQuick 2 are same

I have a QML based Qt UI application, that plays audio. The application was developed using Qt 4.x and has import QtQuick 1.0 statements in all the QML files. I tried to calculate the FPS for the application by deriving from QDeclarativeItem class and implementing paint(QPainter *) function. The FPS was around 60.

Later, I ported the same application to use QtQuick 2.0. It has import QtQuick 2.0 statements in the QML files and some other changes required to run the application using QtQuick 2.0. Again, I tried to calculate the FPS for the application by deriving from QQuickPaintedItem and implementing paint(QPainter *painter) function. The FPS calculated is again around 60.

I expected the first application based on QtQuick 1.0 to have lesser FPS compared to the second application. But, it was not. Is this behavior expected? I do not have any OpenGL calls in my application. The application has just normal QML components like, Rectangle, Item, Image.

My FPS calculation method is based on the solution in another thread Show FPS in QML

Upvotes: 1

Views: 376

Answers (1)

S.M.Mousavi
S.M.Mousavi

Reputation: 5226

The optimum FPS which animations will be looked smooth is 60. Also most typical display's refresh rate is 60 HZ.
So the ideal FPS is 60 and more is wasteful. Therefore most UI frameworks limits FPS to 60 (more info about vsync).

But to make this possible, app must does its job within ~16ms between each render (1000ms/60fps ~= 16ms). In other words, if app runs animation and binds somethings and calculates equations and so on, app MUST finishes them within 16ms. Otherwise user will experience a frame lost which results a jump.

QtQuick 2 shines here! because it uses some elegant technics such as multi-threaded UI, JIT, QMLCompiler,... and enhanced using optimised C++ codes.

In the result, apps which made using QtQuick 2 will be more smooth and fluent.

Upvotes: 0

Related Questions