help-octave
[Top][All Lists]
Advanced

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

Octave interpreter slowness


From: John Swensen
Subject: Octave interpreter slowness
Date: Wed, 15 Mar 2006 15:40:36 -0700
User-agent: Thunderbird 1.4.1 (Windows/20051006)

In some recent work, I wasn't able to get our companies' only Matlab
Statistics toolbox license, so I switched to octave for a week or two. 
I noticed that the poisson random function in octave took orders of
magnitude longer than Matlab's implementation.  This led me to do a
simple experiment.  I ran the following script on the same computer with
both Matlab and Octave (WinXP with Cygwin Octave release vs. Matlab
7.something), with very interesting results.
-------------------------------
tic
size = 1000000;
var = zeros(1,size);
for i = 1:size
  var(i) = rand();
end
sum(var)
ElapsedTime = toc
-------------------------------

Matlab (10 runs) - Ave = 2.0818 seconds
Octave (10 runs) - Ave = 19.911 seconds

Since this is a fairly simple script with a lot of iterations, does this
indicate that the discrepency is caused somewhere in the parsing
portions of Octave?  I tried the test again with the rand() call
eliminated with similar differences in execution times.  I then tried
the script in Octave on a faster PC running Ubuntu with some
improvements (15 seconds per).

John Swensen




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