help-octave
[Top][All Lists]
Advanced

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

Re: Differences in Matlab/Octave processing time


From: Sergei Steshenko
Subject: Re: Differences in Matlab/Octave processing time
Date: Fri, 30 May 2008 13:32:43 -0700 (PDT)

--- Jaroslav Hajek <address@hidden> wrote:

> On Thu, May 29, 2008 at 5:50 PM, HempyElmo <address@hidden> wrote:
> >
> > Hi,
> >
> > I've got a Matlab code which I want to run on Octave. With Matlab this
> > program takes about 5 minutes under Windows XP on a Intel Pentium 4 2.4 GHz
> > to make an output .mat. With Octave on the same computer, it took ages...
> > maybe 30 times more processing time. Same thing happens for Octave with the
> > same version (2.9.15) on a Linux machine (Intel Xeon 2.8 GHz). Is anybody
> > have a reason why? Is it because of Octave or the code itself?
> >
> > The code reproduce a particle in cells simulation. I don't know how many
> > loops it makes.
> >
> > Thanks!
> 
> This can be caused by a lot of reasons. If you use a recent version of
> Matlab, you may be benefitting from the JIT compilation. Octave does
> not have such feature yet; however it is (IMHO) less needed because
> Octave has more powerful support for compiled functions.
> 
> If you post code, someone may give you optimization hints.
> 
> > --
> > View this message in context:
> http://www.nabble.com/Differences-in-Matlab-Octave-processing-time-tp17537903p17537903.html
> > Sent from the Octave - General mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Help-octave mailing list
> > address@hidden
> > https://www.cae.wisc.edu/mailman/listinfo/help-octave
> >
> 
> 
> -- 
> RNDr. Jaroslav Hajek
> computing expert
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
> 

Alas, there might be deeper than JIT/vectorization reasons for slowness.

For example, table lookup of 'sin' implemented in 'octave' is not faster than 
direct 'sin'
calculation, while in "C" it is faster;

So I decided to compare 'octave' with pure "C", and the testcase was something 
very simple like

N = 500000;
k = 2 * pi / N;
tic;vec = sin(k * (0:N));toc

- 'octave' speed was ~5x (IIRC) slower than "C", so I had to implement that set 
of calculations
in "C".

Regards,
  Sergei.




Applications From Scratch: http://appsfromscratch.berlios.de/


      


reply via email to

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