3d performance question

I'm using fedora (17) linux. I notice on complicated 3d plot, interactive
performance can get sluggish. I'm using nouveau driver now, but wondering if
installing nvidia driver will improve mpl 3d performance? Does mpl use opengl?

Hi Neal, my understanding is that matplotlib does not use OpenGL (thus
the terrible performance you see). You might want to look into glumpy
for mplot3d OpenGL acceleration.

Ethan

···

On Dec 14, 2012, at 5:23 AM, Neal Becker <ndbecker2@...287...> wrote:

I'm using fedora (17) linux. I notice on complicated 3d plot, interactive
performance can get sluggish. I'm using nouveau driver now, but wondering if
installing nvidia driver will improve mpl 3d performance? Does mpl use opengl?

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Interactive 2D plots can be sluggish too, if you have enough objects in them. It is not the backend that is sluggish. Replacing the backend does not speed up the frontend.

OpenGL is only 'fast' if you have a frontend that exploits it (e.g. uses vertex buffers and vertex shaders). If you just use OpenGL for bitblitting an image or drawing vertices individually (glVertex*), it is not going to help at all.

My impression is that whenever Matplotlib is 'too slow', I have to go down to the iron and use OpenGL directly. It tends to happen when there are too many objects to draw, and the drawing has to happen in 'real-time'.

Observe that if we let OpenGL render to a frame buffer, we can copy its content into a Matplotlib canvas. Unless we are doing some really heavy real-time graphics, displaying the image is not going to be the speed limiting factor. Even though using OpenGL to swap framebuffers will be 'faster', you will not be able to tell the difference in an interactive Matplotlib plotting.

Sturla

···

On 14.12.2012 15:51, Ethan Gutmann wrote:

Hi Neal, my understanding is that matplotlib does not use OpenGL (thus
the terrible performance you see). You might want to look into glumpy
for mplot3d OpenGL acceleration.

Ethan

On Dec 14, 2012, at 5:23 AM, Neal Becker<ndbecker2@...287...> wrote:

I'm using fedora (17) linux. I notice on complicated 3d plot, interactive
performance can get sluggish. I'm using nouveau driver now, but wondering if
installing nvidia driver will improve mpl 3d performance? Does mpl use opengl?

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I'm curious: how come Chaco is so much faster for real-time plots? What are the main technical differences to enable it to plot things much more quickly?

Thanks,

Jason

···

On 12/18/12 6:53 AM, Sturla Molden wrote:

Interactive 2D plots can be sluggish too, if you have enough objects in
them. It is not the backend that is sluggish. Replacing the backend does
not speed up the frontend.

OpenGL is only 'fast' if you have a frontend that exploits it (e.g. uses
vertex buffers and vertex shaders). If you just use OpenGL for
bitblitting an image or drawing vertices individually (glVertex*), it is
not going to help at all.

My impression is that whenever Matplotlib is 'too slow', I have to go
down to the iron and use OpenGL directly. It tends to happen when there
are too many objects to draw, and the drawing has to happen in 'real-time'.

Observe that if we let OpenGL render to a frame buffer, we can copy its
content into a Matplotlib canvas. Unless we are doing some really heavy
real-time graphics, displaying the image is not going to be the speed
limiting factor. Even though using OpenGL to swap framebuffers will be
'faster', you will not be able to tell the difference in an interactive
Matplotlib plotting.

This is a great summary of the issues related to OpenGL, and how it can help but is not a universal panacea.

Thanks,
Mike

···

On 12/18/2012 08:53 AM, Sturla Molden wrote:

Interactive 2D plots can be sluggish too, if you have enough objects in
them. It is not the backend that is sluggish. Replacing the backend does
not speed up the frontend.

OpenGL is only 'fast' if you have a frontend that exploits it (e.g. uses
vertex buffers and vertex shaders). If you just use OpenGL for
bitblitting an image or drawing vertices individually (glVertex*), it is
not going to help at all.

My impression is that whenever Matplotlib is 'too slow', I have to go
down to the iron and use OpenGL directly. It tends to happen when there
are too many objects to draw, and the drawing has to happen in 'real-time'.

Observe that if we let OpenGL render to a frame buffer, we can copy its
content into a Matplotlib canvas. Unless we are doing some really heavy
real-time graphics, displaying the image is not going to be the speed
limiting factor. Even though using OpenGL to swap framebuffers will be
'faster', you will not be able to tell the difference in an interactive
Matplotlib plotting.

Sturla

On 14.12.2012 15:51, Ethan Gutmann wrote:

Hi Neal, my understanding is that matplotlib does not use OpenGL (thus
the terrible performance you see). You might want to look into glumpy
for mplot3d OpenGL acceleration.

Ethan

On Dec 14, 2012, at 5:23 AM, Neal Becker<ndbecker2@...287...> wrote:

I'm using fedora (17) linux. I notice on complicated 3d plot, interactive
performance can get sluggish. I'm using nouveau driver now, but wondering if
installing nvidia driver will improve mpl 3d performance? Does mpl use opengl?

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I think this a great question -- one way to address this might be to find certain examples or plot types where the performance has a large gap and then drill down from there. There are so many different plot types and methods in both matplotlib and Chaco that it's hard to be general about performance issues. (And raw drawing performance isn't always the same thing as interactive performance, or file size or memory performance). I know years ago when I was working on the path simplification code in matplotlib it was way ahead of what Chaco was doing in that (very narrow and specific) case, but I haven't looked at Chaco much since.

Mike

···

On 12/18/2012 09:21 AM, Jason Grout wrote:

On 12/18/12 6:53 AM, Sturla Molden wrote:

Interactive 2D plots can be sluggish too, if you have enough objects in
them. It is not the backend that is sluggish. Replacing the backend does
not speed up the frontend.

OpenGL is only 'fast' if you have a frontend that exploits it (e.g. uses
vertex buffers and vertex shaders). If you just use OpenGL for
bitblitting an image or drawing vertices individually (glVertex*), it is
not going to help at all.

My impression is that whenever Matplotlib is 'too slow', I have to go
down to the iron and use OpenGL directly. It tends to happen when there
are too many objects to draw, and the drawing has to happen in 'real-time'.

Observe that if we let OpenGL render to a frame buffer, we can copy its
content into a Matplotlib canvas. Unless we are doing some really heavy
real-time graphics, displaying the image is not going to be the speed
limiting factor. Even though using OpenGL to swap framebuffers will be
'faster', you will not be able to tell the difference in an interactive
Matplotlib plotting.

I'm curious: how come Chaco is so much faster for real-time plots? What
are the main technical differences to enable it to plot things much more
quickly?