help-octave
[Top][All Lists]
Advanced

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

Re: octave benchmark test


From: David Bateman
Subject: Re: octave benchmark test
Date: Tue, 9 Mar 2004 10:44:15 +0100
User-agent: Mutt/1.4.1i

Michael,

Please do the following

1) Upgrade to 2.1.56 from 2.1.53 due to the bugs in 2.1.53 and some speed-up
2) Please install the latest version of octave-forge where the sort and randn
   codes are sped-up, which you are clearly missing.
3) Please check that you are linked against Atlas and FFTW for acceleration of
   matrix and fft operations. Use the 'octave_config_info' command and look
   for BLAS_LIBS and FFTW_LIBS and see what they are set to.
4) For the 100x case please vectorize your code....

Do this and then we can talk on an even footing about speed....

According to Michael Martin <address@hidden> (on 03/08/04):
> 
> The float test is a rather interesting result. The code for it is as 
> follows:
> 
> %% Float test ---------------------------------------------------
>       fprintf('Float test\n');
>       tic
>     for j = 1:100
>               a = 1;
>               for i = 1:2000
>                       a = tan(atan(exp(log(sqrt(a*a))))) + 1;
>               end
>     end
>       elapsedTime = toc;
>       fprintf ('a = %f, err = %f, time = %f\n\n', a, a - 2001, 
>       elapsedTime);

Vectorize code wherever possible!!!!! Octave doesn't have JIT which is
where Matlab wins on this case. The above is a null example, since the
core of the algorithm results in a null operation as
'tan(atan(exp(log(sqrt(a*a))))) = a', so a vectorized version is

a = 2001;

But if you are getting such big differences between matlab and octave it
is time to consider how you have written your code, and probably make 
similar simplifications to the above.

Regards
David

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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