Mayavi slow ?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Mayavi slow ?

Éric Depagne
Hi all.

I am using mlab.surf to plot an array whose shape is (1500,1000) made of
float32.

The rendering is slow, and then when I rotate the plot, it's slow too (as i it
sometimes take one second to update the plot).

I was wondering if it is due to the size of the array I'm plotting, or if I
shall look at my configuration.

Thanks a lot.

Éric.
--
Un clavier azerty en vaut deux
----------------------------------------------------------
Éric Depagne                            [hidden email]
Las Cumbres Observatory
6740 Cortona Dr
Goleta CA, 93117
----------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow ?

Chris Colbert
That's a large array, and it could be slow depending on your machine.

On a laptop with a qx9300 and gtx280m I get a refresh rate ~10hz (best guestimate) for such an array. 


On Fri, Apr 2, 2010 at 3:26 PM, Éric Depagne <[hidden email]> wrote:
Hi all.

I am using mlab.surf to plot an array whose shape is (1500,1000) made of
float32.

The rendering is slow, and then when I rotate the plot, it's slow too (as i it
sometimes take one second to update the plot).

I was wondering if it is due to the size of the array I'm plotting, or if I
shall look at my configuration.

Thanks a lot.

Éric.
--
Un clavier azerty en vaut deux
----------------------------------------------------------
Éric Depagne                            [hidden email]
Las Cumbres Observatory
6740 Cortona Dr
Goleta CA, 93117
----------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow ?

Guy K. Kloss-2
On Sat, 03 Apr 2010 09:25:43 Chris Colbert wrote:
> On a laptop with a qx9300 and gtx280m I get a refresh rate ~10hz (best
> guestimate) for such an array.

You might also have some success setting your GUI backend to something with a
little more zing than the wx implementation. In my experience setting the
environment variable ETS_TOOLKIT=qt4 (for the Qt4 backend) gave quite some
better performance (at the slight expense of delayed initial rendering).

HTH,

Guy

--
Guy K. Kloss
Institute of Information and Mathematical Sciences
Te Kura Pūtaiao o Mōhiohio me Pāngarau
Massey University, Albany (North Shore City, Auckland)
473 State Highway 17, Gate 1, Mailroom, Quad B Building
voice: +64 9 414-0800 ext. 9266   fax: +64 9 441-8181
[hidden email] http://www.massey.ac.nz/~gkloss

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow ?

Gael Varoquaux
On Sat, Apr 03, 2010 at 10:37:46AM +1300, Guy K. Kloss wrote:
> On Sat, 03 Apr 2010 09:25:43 Chris Colbert wrote:
> > On a laptop with a qx9300 and gtx280m I get a refresh rate ~10hz (best
> > guestimate) for such an array.

> You might also have some success setting your GUI backend to something with a
> little more zing than the wx implementation. In my experience setting the
> environment variable ETS_TOOLKIT=qt4 (for the Qt4 backend) gave quite some
> better performance (at the slight expense of delayed initial rendering).

This is most probably due to the sub-optimal redraw strategy that we are
using under wx, as pointed out in:
https://svn.enthought.com/enthought/ticket/1744

I haven't had time to triage this ticket, and my schedule is looking
pretty bad right now. Care to give it a try and tell me if it improves
the situation?

Cheers,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow ?

Gael Varoquaux
In reply to this post by Éric Depagne
On Fri, Apr 02, 2010 at 12:26:14PM -0700, Éric Depagne wrote:
> Hi all.

> I am using mlab.surf to plot an array whose shape is (1500,1000) made of
> float32.

> The rendering is slow, and then when I rotate the plot, it's slow too
> (as i it sometimes take one second to update the plot).

> I was wondering if it is due to the size of the array I'm plotting, or if I
> shall look at my configuration.

I am whitnessing OK performance on the following example (which should be
pretty close to your problem):

from enthought.mayavi import mlab
import numpy as np

x, y = np.mgrid[-1:1:1000j, -1:1:1500j]
z = x**2 + y**2

mlab.clf()
mlab.surf(z)
mlab.show()

I am getting several redraws a second when I rotate, though, so I suspect
that you may have a configuration problem, for instance, lack of hardware
acceleration.

As Guy points out, there is probably some gain to be made (factor of 2?)
in redraw speed under Wx. I'll try to check in a fix before next release,
but in the mean time, I don't see an easy way to improve things on the
Mayavi side (to put things in perspective, you are visualizing 3 million
triangles).

One option would be decimation: have a look at
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_canyon_decimation.html
(but replace the download URL by
http://staging.enthought.com/projects/mayavi/N36W113.hgt.zip, as the NASA
URL is down.

This decimation will increase your first render time, but should help
making redraws much faster.

Cheers,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow

Éric Depagne
In reply to this post by Guy K. Kloss-2
Le vendredi 2 avril 2010 13:25:43, Chris Colbert a écrit :
> That's a large array, and it could be slow depending on your machine.
>
> On a laptop with a qx9300 and gtx280m I get a refresh rate ~10hz (best
> guestimate) for such an array.
>
Hi Chris, Guy, Gael and list.

It's probably my configuration that's causing me the problem. I've tested the
code on another machine, and even if it's not lightning fast, it's still
faster, on a less powerful machine.
I'll have a look at my configuration on monday, and I'll lt you know.

Thanks for the help.

Éric.
--
Un clavier azerty en vaut deux
----------------------------------------------------------
Éric Depagne                            [hidden email]
Las Cumbres Observatory
6740 Cortona Dr
Goleta CA, 93117
----------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow

Gael Varoquaux
On Sat, Apr 03, 2010 at 04:39:07PM -0700, Éric Depagne wrote:
> It's probably my configuration that's causing me the problem. I've tested the
> code on another machine, and even if it's not lightning fast, it's still
> faster, on a less powerful machine.
> I'll have a look at my configuration on monday, and I'll lt you know.

I am glad to hear this, althought you would probably have prefered
another outcome :).

Good luck with the configuration.

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow

Éric Depagne
Le samedi 3 avril 2010 16:41:20, Gael Varoquaux a écrit :
> On Sat, Apr 03, 2010 at 04:39:07PM -0700, Éric Depagne wrote:
> > It's probably my configuration that's causing me the problem. I've tested
> > the code on another machine, and even if it's not lightning fast, it's
> > still faster, on a less powerful machine.
> > I'll have a look at my configuration on monday, and I'll lt you know.
>
> I am glad to hear this, althought you would probably have prefered
> another outcome :).
Well, somehow I'm glad it's my machine, it's easier to fix than if it were
mayavi who could not efficiently display my array !

Éric.
>
> Good luck with the configuration.
>
> Gaël
>

--
Un clavier azerty en vaut deux
----------------------------------------------------------
Éric Depagne                            [hidden email]
Las Cumbres Observatory
6740 Cortona Dr
Goleta CA, 93117
----------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow ?

Éric Depagne
In reply to this post by Gael Varoquaux
Le samedi 3 avril 2010 16:25:26, Gael Varoquaux a écrit :

> On Fri, Apr 02, 2010 at 12:26:14PM -0700, Éric Depagne wrote:
> > Hi all.
> >
> > I am using mlab.surf to plot an array whose shape is (1500,1000) made of
> > float32.
> >
> > The rendering is slow, and then when I rotate the plot, it's slow too
> > (as i it sometimes take one second to update the plot).
> >
> > I was wondering if it is due to the size of the array I'm plotting, or if
> > I shall look at my configuration.
>
> I am whitnessing OK performance on the following example (which should be
> pretty close to your problem):
>
> from enthought.mayavi import mlab
> import numpy as np
>
> x, y = np.mgrid[-1:1:1000j, -1:1:1500j]
> z = x**2 + y**2
>
> mlab.clf()
> mlab.surf(z)
> mlab.show()
>
> I am getting several redraws a second when I rotate, though, so I suspect
> that you may have a configuration problem, for instance, lack of hardware
> acceleration.
>
> As Guy points out, there is probably some gain to be made (factor of 2?)
> in redraw speed under Wx. I'll try to check in a fix before next release,
> but in the mean time, I don't see an easy way to improve things on the
> Mayavi side (to put things in perspective, you are visualizing 3 million
> triangles).
>
> One option would be decimation: have a look at
> http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto
> /example_canyon_decimation.html (but replace the download URL by
> http://staging.enthought.com/projects/mayavi/N36W113.hgt.zip, as the NASA
> URL is down.
>
> This decimation will increase your first render time, but should help
> making redraws much faster.
>
> Cheers,
>
> Gaël
>
Hi Gael and list,

I've added some more memory to my machine and it's now lightning fast (as in I
can rotate my figure as fast as I want without noticing any slowness anymore).

Éric.
--
Un clavier azerty en vaut deux
----------------------------------------------------------
Éric Depagne                            [hidden email]
Las Cumbres Observatory
6740 Cortona Dr
Goleta CA, 93117
----------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow ?

Brennan Williams
Éric Depagne wrote:

> Le samedi 3 avril 2010 16:25:26, Gael Varoquaux a écrit :
>  
>> On Fri, Apr 02, 2010 at 12:26:14PM -0700, Éric Depagne wrote:
>>    
>>> Hi all.
>>>
>>> I am using mlab.surf to plot an array whose shape is (1500,1000) made of
>>> float32.
>>>
>>> The rendering is slow, and then when I rotate the plot, it's slow too
>>> (as i it sometimes take one second to update the plot).
>>>
>>> I was wondering if it is due to the size of the array I'm plotting, or if
>>> I shall look at my configuration.
>>>      
>> I am whitnessing OK performance on the following example (which should be
>> pretty close to your problem):
>>
>> from enthought.mayavi import mlab
>> import numpy as np
>>
>> x, y = np.mgrid[-1:1:1000j, -1:1:1500j]
>> z = x**2 + y**2
>>
>> mlab.clf()
>> mlab.surf(z)
>> mlab.show()
>>
>> I am getting several redraws a second when I rotate, though, so I suspect
>> that you may have a configuration problem, for instance, lack of hardware
>> acceleration.
>>
>> As Guy points out, there is probably some gain to be made (factor of 2?)
>> in redraw speed under Wx. I'll try to check in a fix before next release,
>> but in the mean time, I don't see an easy way to improve things on the
>> Mayavi side (to put things in perspective, you are visualizing 3 million
>> triangles).
>>
>> One option would be decimation: have a look at
>> http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto
>> /example_canyon_decimation.html (but replace the download URL by
>> http://staging.enthought.com/projects/mayavi/N36W113.hgt.zip, as the NASA
>> URL is down.
>>
>> This decimation will increase your first render time, but should help
>> making redraws much faster.
>>
>> Cheers,
>>
>> Gaël
>>
>>    
> Hi Gael and list,
>
> I've added some more memory to my machine and it's now lightning fast (as in I
> can rotate my figure as fast as I want without noticing any slowness anymore).
>
>  
I wasn't following this thread closely so what was your original
hardware spec in terms of CPU,memory,graphics? And how much memory do
you now have? And OS? Windows or Linux?

Brennan


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi slow ?

Gael Varoquaux
In reply to this post by Éric Depagne
On Mon, Apr 12, 2010 at 05:58:06PM -0700, Éric Depagne wrote:
> I've added some more memory to my machine and it's now lightning fast
> (as in I can rotate my figure as fast as I want without noticing any
> slowness anymore).

Fantastic. I had a small look at improving speed yesterday, and I
couldn't find some place where we were doing something obviously stupid.

Thanks for the heads up.

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev