New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance questions #6

Open
jcelerier opened this Issue Jan 5, 2016 · 10 comments

Comments

Projects
None yet
3 participants
@jcelerier

jcelerier commented Jan 5, 2016

In the small qnanopainter vs qpainter benchmark, I have roughly 60 fps for QPainter and 40 - 45 fps for QNanoPainter.

What could be the cause of inferior performance ?

@QUItCoding

This comment has been minimized.

Show comment
Hide comment
@QUItCoding

QUItCoding Jan 5, 2016

Owner

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:

  • QPainter+QImage: 3fps
  • QPainter+FBO: 12fps
  • QNanoPainter: 60fps
Owner

QUItCoding commented Jan 5, 2016

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:

  • QPainter+QImage: 3fps
  • QPainter+FBO: 12fps
  • QNanoPainter: 60fps
@jcelerier

This comment has been minimized.

Show comment
Hide comment
@jcelerier

jcelerier Jan 6, 2016

My computer :
i7-4770 CPU @ 3.40GHz
Radeon HD 8570 / R7 240/340 OEM
Arch Linux x64

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
QPainter + FBO : always at 60 fps
QPainter : for test rendering count 1 -> 8 values are : 62 62 60 48 48 37 28 23

jcelerier commented Jan 6, 2016

My computer :
i7-4770 CPU @ 3.40GHz
Radeon HD 8570 / R7 240/340 OEM
Arch Linux x64

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
QPainter + FBO : always at 60 fps
QPainter : for test rendering count 1 -> 8 values are : 62 62 60 48 48 37 28 23

@QUItCoding

This comment has been minimized.

Show comment
Hide comment
@QUItCoding

QUItCoding Jan 6, 2016

Owner

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.

Owner

QUItCoding commented Jan 6, 2016

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.

@NielsMayer

This comment has been minimized.

Show comment
Hide comment
@NielsMayer

NielsMayer Jan 7, 2016

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.

NielsMayer commented Jan 7, 2016

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.

@jcelerier

This comment has been minimized.

Show comment
Hide comment
@jcelerier

jcelerier Jan 7, 2016

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.

Maybe it would be worth to investigate GLES vs desktop OpenGL ?

jcelerier commented Jan 7, 2016

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.

Maybe it would be worth to investigate GLES vs desktop OpenGL ?

@NielsMayer

This comment has been minimized.

Show comment
Hide comment
@NielsMayer

NielsMayer commented Jan 7, 2016

@QUItCoding

This comment has been minimized.

Show comment
Hide comment
@QUItCoding

QUItCoding Jan 7, 2016

Owner

Thanks Niels!

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.

qnanopainter_debug

Owner

QUItCoding commented Jan 7, 2016

Thanks Niels!

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.

qnanopainter_debug

@QUItCoding

This comment has been minimized.

Show comment
Hide comment
@QUItCoding

QUItCoding Jan 13, 2016

Owner

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:

  • QPainter+QImage: 1=60fps, 2=41fps, 4=26fps, 8=15fps, 16=9fps, 32=4fps
  • QPainter+FBO: 1=60fps, 2=60fps, 4=60fps, 8=30fps, 16=16fps, 32=9fps
  • QNanoPainter: 1=60fps, 2=60fps, 4=60fps, 8=60fps, 16=38fps, 32=19fps

👉 QNanoPainter ~4 times faster than QPainter with comparable antialiased output (QImage) and ~2 times faster than non-antialiased QPainter+FBO.

Ubuntu 12.04, i7-2640M@2.8GHz, NVIDIA Quadro 2000M with proprietary drivers, Qt 5.5.1:

  • QPainter+QImage: 1=60fps, 2=39fps, 4=26fps, 8=14fps, 16=8fps, 32=4fps
  • QPainter+FBO: 1=60fps, 2=60fps, 4=60fps, 8=32fps, 16=20fps, 32=10fps
  • QNanoPainter: 1=60fps, 2=60fps, 4=60fps, 8=60fps, 16=60fps, 32=55fps

👉 This Nvidia card supports GL_EXT_framebuffer_multisample and GL_EXT_framebuffer_blit so both QPainter+QImage and QPainter+FBO can render high-quality antialiased output, comparable to QNanoPainter.
👉 QNanoPainter ~10 times faster than QPainter+QImage and ~5 times faster than QPainter+FBO.

Owner

QUItCoding commented Jan 13, 2016

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:

  • QPainter+QImage: 1=60fps, 2=41fps, 4=26fps, 8=15fps, 16=9fps, 32=4fps
  • QPainter+FBO: 1=60fps, 2=60fps, 4=60fps, 8=30fps, 16=16fps, 32=9fps
  • QNanoPainter: 1=60fps, 2=60fps, 4=60fps, 8=60fps, 16=38fps, 32=19fps

👉 QNanoPainter ~4 times faster than QPainter with comparable antialiased output (QImage) and ~2 times faster than non-antialiased QPainter+FBO.

Ubuntu 12.04, i7-2640M@2.8GHz, NVIDIA Quadro 2000M with proprietary drivers, Qt 5.5.1:

  • QPainter+QImage: 1=60fps, 2=39fps, 4=26fps, 8=14fps, 16=8fps, 32=4fps
  • QPainter+FBO: 1=60fps, 2=60fps, 4=60fps, 8=32fps, 16=20fps, 32=10fps
  • QNanoPainter: 1=60fps, 2=60fps, 4=60fps, 8=60fps, 16=60fps, 32=55fps

👉 This Nvidia card supports GL_EXT_framebuffer_multisample and GL_EXT_framebuffer_blit so both QPainter+QImage and QPainter+FBO can render high-quality antialiased output, comparable to QNanoPainter.
👉 QNanoPainter ~10 times faster than QPainter+QImage and ~5 times faster than QPainter+FBO.

@jcelerier

This comment has been minimized.

Show comment
Hide comment
@jcelerier

jcelerier commented Jan 13, 2016

awesome !

@NielsMayer

This comment has been minimized.

Show comment
Hide comment
@NielsMayer

NielsMayer Feb 28, 2016

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:

qt.scenegraph.info: animation driver switched to vsync mode
(and fixed at 59fps)

In QPainter mode, the following is output:

qt.scenegraph.info: animation driver switched to timer mode
(and 34-40fps)

In QPainter mode, Switching the Advanced->FBO Render Target (QPainter) outputs:

qt.scenegraph.info: animation driver switched to vsync mode
(and fixed at 59fps).

Without QSG_RENDER_LOOP=threaded the demo outputs:

qt.scenegraph.info: QSG: basic render loop

QNanoPainter: 44-49fps
QPainter: 36-44fps
QPainter with FBO Render Target option: 62fps

See output from QSG_INFO with different render loops:
qnanopainter-threaded-render-loop.txt
qnanopainter-basic-render-loop.txt

NielsMayer commented Feb 28, 2016

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:

qt.scenegraph.info: animation driver switched to vsync mode
(and fixed at 59fps)

In QPainter mode, the following is output:

qt.scenegraph.info: animation driver switched to timer mode
(and 34-40fps)

In QPainter mode, Switching the Advanced->FBO Render Target (QPainter) outputs:

qt.scenegraph.info: animation driver switched to vsync mode
(and fixed at 59fps).

Without QSG_RENDER_LOOP=threaded the demo outputs:

qt.scenegraph.info: QSG: basic render loop

QNanoPainter: 44-49fps
QPainter: 36-44fps
QPainter with FBO Render Target option: 62fps

See output from QSG_INFO with different render loops:
qnanopainter-threaded-render-loop.txt
qnanopainter-basic-render-loop.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment