[Numpy-discussion] slow numpy.clip ?

David Cournapeau david at ar.media.kyoto-u.ac.jp
Tue Dec 19 02:17:01 CST 2006

Gael Varoquaux wrote:
> On Tue, Dec 19, 2006 at 02:10:29PM +0900, David Cournapeau wrote:
>> I would really like to see the imshow/show calls goes in the range of a 
>> few hundred ms; for interactive plotting, this really change a lot in my 
>> opinion.
> I think this is strongly dependant on some parameters. I did some
> interactive plotting on both a pentium 2, linux, WxAgg (thus Gtk behind
> Wx), and a pentium 4, windows, WxAgg (thus MFC behin Wx), and there was a
> huge difference between the speeds. The speed difference was a few orders
> of magnitudes. I couldn't explain it but it was a good surprise, as the
> application was developped for the windows box.
I started to investigate the problem because under matlab, plotting a 
spectrogram is negligeable compared to computing it, whereas in 
matplotlib with numpy array backend, plotting it takes as much time as 
computing it, which didn't make sense to me.

Most of the computing time is spend into code which is independent of 
the backend, that is during the conversion from the rank 2 array to rgba 
(60 % of the time of my fast workstation, 85 % of the time on my laptop 
with a pentium M @ 1.2 Ghz), so I don't think the GUI backend makes any 



More information about the Numpy-discussion mailing list