John Hunter wrote:
>
>
>     David> In make_image, most of the time is taken into to_rgba:
>     David> almost half of it is taken in by the take call in the
>     David> Colormap.__call__. Almost 200 ms to get colors from the
>     David> indexes seems quite a lot (this means 280 cycles / pixel on
>     David> average !). I can reproduce this number by using a small
>     David> numpy test.
>
>     David> On my laptop (pentium M, 1.2 Ghz), make_image takes almost
>     David> 85 % of the time, which seems to imply that this is where
>     David> one should focus if one wants to improve the speed,
>
> This may have been lost in the longer thread above,
I am a bit lost myself between numpy and mpl ML, sorry for the 
inconvenience.
>  but what
> interpolation are you using?  You may see a good performance boost by
> using interpolation='nearest'.  
At  what point is interpolation used ?
> Also, with your clip changes and with
> Eric's changes is it still painfully slow for you
Painfully is a strong word :) It is still 10 to 15 times slower than 
matlab on the same computer: the show call is around 800 ms instead of 
70 ms with matlab, and matlab image is equivalent to imshow + show calls 
actually. Matlab having only one toolkit, it obviously has an advantage, 
but I don't think the problem is on the GUI side anyway.
>  -- how much have
> these changes helped? 
With the original profiling, it took a bit more than  2100 ms for a show 
call after a imshow call for a 8000x256 array according to a saved 
kcachegrind profile. Now, it is around 800 ms, which is already much 
better, and with minimal changes (eg without using a special fast path 
more prone to bugs). I estimate that squeezing to a bit less than 500 ms 
should be easily possible by improving on numpy side (clip, float to int 
convertion and take function), which has the nice effect of improving 
mpl without touching one line of it, and improving numpy as the same time :)

The last 500 ms would be much more difficult to squeeze: half of it is 
used to 'launch' the figure anyway. And below a few hundred ms, it is 
becoming unnoticeable in interactive use  (whereas the change from 2.1 s 
to 0.8 is; on my laptop, it is even more noticeable, because its CPU is 
kind of slow).

David


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to