[Numpy-discussion] speeding up y[:, i] for y.shape = (big number, small number)

David Cournapeau david at ar.media.kyoto-u.ac.jp
Wed Oct 4 06:13:22 CDT 2006

David Cournapeau wrote:
> Here we are (the difference may not seem that much between the two 
> multiple_ga, but in reality, _diag_gauss_den is an internal function 
> which is done in C, and is much faster... By writing this example, I've 
> just realized that the function _diag_gauss_den may be slow for exactly 
> the same reasons):
I checked my assumption about the _diag_gauss_den function being slow 
because of the same problem, and this is indeed the case:

If I replace X = randn(nframes, d) by X = randn(d, nframes); X   = X.T, 
the function is mode than twice as fast ! This seems way to much of a 
difference to me....


More information about the Numpy-discussion mailing list