help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indexing expression performance


From: Francesco Potortì
Subject: Re: indexing expression performance
Date: Thu, 15 Jan 2009 13:48:21 +0100

I had written:
>>Also, Francesco, I forgot to do the obvious thing and test your examples
>>with 3.1.51. At least on my machine, it looks like the performance has been
>>reversed by the latest dense indexing improvements.
>>
>>octave:1> kk=rand(156,222,1,44,8);
>>octave:2> t=cputime; for ii=1:44, for jj=1:8, mm=kk(:,:,:,ii,jj); endfor,
>>endfor, cputime-t
>>ans =  0.072004
>>octave:3> cp=[1,cumprod(size(kk)(1:end-1))]; len=156*222; t=cputime; for
>>ii=1:44, for jj=1:8,base=sum(([1,1,1,ii,jj]-1).*cp); mm=kk(base+1:base+len);
>>endfor, endfor, cputime-t
>>ans =  0.12401
>
>Wonderful!  This will make my code more readable as soon as I upgrade :)

Hm.  I installed Octave 3.1.51 from Debian's "experimental" (I never got
round to finding the time to build Octave myself).  I use an amd64 box.
Unfortunately, I see no big difference with 3.0.1 :(

The timings of the first test versus the second on my box are: 
- 5.1s versus 0.30s with 3.0.1
- 5.2s versus 0.27s with 3.1.51

So apparently I am not benefitting from the 3.1.51 dense indexing improvements.

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]