help-octave
[Top][All Lists]
Advanced

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

Re: matlab/octave performance hit


From: Quentin Spencer
Subject: Re: matlab/octave performance hit
Date: Thu, 18 Oct 2007 16:30:53 -0500
User-agent: Thunderbird 2.0.0.5 (X11/20070727)

Victor Zhorin wrote:

We tried to see whether we could make existing matlab code to run using octave on parallel cluster.
Unfortunately we found that performance hit is too strong.

It seems that slowness is most likely due to some instrinsic system/octave issues.

Here is a quick example:

tic; test = 1:200; nc = cumsum(test);toc

octave (linux based box, latest release compiled)
Elapsed time is 0.023521 seconds.
matlab (mac, powerpc)
Elapsed time is 0.000064 seconds.
octave (same mac, latest binary package for Mac X installed as-is)
Elapsed time is 0.050179 seconds.

That's a very significant difference in performing the most basic operations. Is there a way we can speed it up or could we possibly miss something in installation?


I should point out that your test is much too small to get an accurate characterization. The tic and toc functions are m files in octave and builtin functions in matlab (BTW, I think this might be a worthwhile enhancement for anyone who wants a small project). Running nothing more than tic; toc takes 0.02 sec in octave and 0.000011 sec in matlab on my computer. So, If I make your test large enough to make that difference negligible:
tic; test = 1:1e7; nc = cumsum(test); toc
I get 0.73 seconds in octave and 0.51 seconds in matlab. For any heavily vectorized operation like this, the times should be not too different. Matlab will be considerably faster on code that is not heavily vectorized because its interpreter is faster. Any contributions to the project to make octave's interpreter faster are welcomed.

Quentin



reply via email to

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