help-octave
[Top][All Lists]
Advanced

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

Re: How to speed up Octave


From: Dirk Eddelbuettel
Subject: Re: How to speed up Octave
Date: Tue, 19 Jun 2001 17:52:06 -0500

> I ran a few tests of execution speed for Octave (2.0.16, from the Mandrake 
> install disks) under Linux (Mandrake 8.0) and Windows (Win2k), and Matlab 
> (version 6) under Windows.  I was disappointed to see how slow Octave is 
> compared to Matlab on my home PC (Athlon 700 MHz with 256 MB SDRAM).  (I 

Two suggestions:

i)  Use Atlas, as was previously mentioned
ii) Use a faster random number generator [1]

For example, I tried your   B=prod(A)   test with A=rand(1000,1000) where I
also average over 10 runs. This is on my 2 year old laptop running Debian 
(where Octave 2.1 is already provided with support for Atlas)

Octave                3.42 sec
Octave/MT [1]      0.49 sec
Matlab                 0.42 sec
 
So once I replace the slowish RNG in Octave, results become comparable to 
Matlab.

Similarly, for the   A=rand(20,20000); B=svd(A)  example:

Octave               2.29 sec
Octave/MT [1]     1.14 sec
Matlab               1.04 sec

Finally, I think there is circumstantial evidence that the gap between Octave 
and Matlab
is wider on Windows than under any Unix as Octave was never written with 
Windows in
mind. The Cygwin layer does cost something in terms of performance.

Dirk

[1] MT refers to the Mersenne Twister. I posted a simple C++ wrapper to 
octave-sources 
a few years ago. It is still at 
http://eddelbuettel.com/dirk/code/octave-mt.html   Also, 
Paul Kienzle recently cleaned the code and his version should be in the Octave 
code 
archive on Sourceforge.

-- 
According to the latest figures, 43% of all signatures are totally worthless.   



-------------------------------------------------------------
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]