Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Performance questions #6
Please tell more, on what HW are you running? Built with QtCreator ’Release’ target and not ’Debug’ target? Running QPainter with default QImage rendertarget ( = CPU paint engine) or FBO rendertarget ( = OpenGL paint engine)?
QPainter+QImage could be faster on powerful PC CPU with poor integrated GPU. QPainter+FBO can also be faster with some paint methods. But in most cases based on our testing QNanoPainter is faster and provides nice antialiased output.
One example: Macbook Pro, 2.8 Core i7, AMD R9 M370X. Demo with all tests on, rendering count 8, window size ~1/2 screen:
My computer :
My results are as follows for a half screen too (1080 * 960) (and yes, in release mode) :
QNanoPainter : always around 45 fps for test rendering count 1 -> 8
Thanks! Interesting that QNanoPainter stays at ~45 fps even when rendering count increases… Don’t know what could be hampering the performance when QPainter+FBO reaches 60 fps. Maybe there is something in NanoVG OpenGL / shaders that AMD HD 8570 (Linux driver) doesn’t handle well? If you can figure out or others have comparable results please share here.
Im seeing similar performance issues on desktop, whereas on Android (NVidia Shield TV) I get a solid 60FPS with QNanoPainter and under 10 with QPainter. On Nexus6, 38-45fps with QNanopainter. 3fps with QPainter.
On Ubuntu Desktop, with the app displayed full-size on second 1280x1024 monitor, QNanoPainter gets 44-45fps (all other settings default), QPainter gets ~ 43-55fps. With FBO renderTarget set, QPainter indicates an unchanging 62fps.
Common with the previous reports, I'm using AMD "radeon" Linux open-source drivers on the desktop ( Ubuntu 14.04LTS + 4.3.0-040300 kernel). I don't think the proprietary drivers are available for my 'Skylake' i7 processor, as the CPU requires the newer kernel I'm running. Thus, I can only comment on the open source driver performance on a low-end AMD Radeon HD 7770 "Tahiti" card (worksforme).
My maxwell-GPU laptop is locked to 48hz (due to high resolution) and exhibits even stranger performance characteristics, with QNanoPainter vs QPainter. With the app sized to half the display-width, 1920x2043, QPainter mode gives 19-20fps w/o, and 47fps (max) with FBO. However the actual animation, with QPainter even at the claimed 47fps, is a fraction of the visually observed animation rate seen in QNanoPainter mode at the same maximum "47fps."
Bottom line is that the FPS indicator in qnanopainter is a bad summary of the actual perceived rate of animation observed, when using a GTX960m and proprietary drivers. The observed rate is at least twice, if not four times greater than seen on either NVidia Shield, Nexus 6, AMD Desktop -- even if the indicated frame-rate shows higher. QNanoPainter on GTX960m shows the "number corkscrew" really flying along at an incredible rate, smoothly. It is impressive looking!
The rate of animation is not nearly as fast, even at 60fps indicated, on platforms like the NVidia Shield TV, Linux desktop with AMD Radeon open-source drivers, or Nexus 6.
Is there a way to show the "rate of animation" rather than the FPS, and is there a way to lock the rate of animation to a clock so that different displays exhibit same application performance, with lower performance platforms just showing a jerkier, lower-fps display?
Corollary: I'm not sure if the significantly faster observed animation rate on GTX960m/proprietary is a bug or a feature. However the vastly different observed animation rates versus similar FPS results appears to be a bug. Alternately, the oddball locked-to-48hz rate on my laptop display may be triggering an entirely different bug that cranks up the animation rate unexpectedly??
PS: QNanoPainter is awesome. Thanks for making it available.
Good point about Fps indicator, it only shows fps the indicator can animate at. This simple approach has served us quite well in other places but it’s very possible that depending on platform QNanoPainter item animates at different pace and fps indicator gives wrong results.
One thing you could try is to enable QNANO_DEBUG in libqnanopainter/include.pri and rebuild. That will show some debug information at the bottom of item, like draw call count and how many triangles are used for filling, stroking and text. TIME shows how much CPU time (in ms) QNanoPainter uses for synchronize() and paint(). It doesn’t tell that much as GPU is mostly the limiting factor, but I’d like to get this debug improved as an easy way to get an overview what’s going on any QNanoPainter item.
Did a bit testing regarding this now. At least on my Linux PC with Mesa, Qt scene graph uses ”basic” render loop by default. This caused showing those < 60 fps numbers even with low load. To use threaded render loop instead, set 'QSG_RENDER_LOOP=threaded' in the environment. See http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html
Now with the above threaded render loop I did some testing on Linux. Demo with all tests on, default window size, adjusting rendering count.
Ubuntu 14.04, i5-2500K@3.3GHz, integrated HD3000 GPU, Qt 5.5.1:
Ubuntu 12.04, i7-2640M@2.8GHz, NVIDIA Quadro 2000M with proprietary drivers, Qt 5.5.1:
On Linux Desktop, Using envvar "QSG_INFO=1" and "QSG_RENDER_LOOP=threaded" suggested in http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html -- note output when switching to QNanoPainter mode in qnanopainter_vs_qpainter_demo:
In QPainter mode, the following is output:
In QPainter mode, Switching the Advanced->FBO Render Target (QPainter) outputs:
Without QSG_RENDER_LOOP=threaded the demo outputs: