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: Michael Goffioul
Subject: Re: Differences in Matlab/Octave processing time
Date: Fri, 30 May 2008 17:41:01 +0200

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.

The most probable reason is the (heavy?) presence of loops (for, while...),
which are completely interpreted, while Matlab use a JIT compiler to speed
up things. You should vectorize your code as much as possible to get
similar processing time as Matlab.

Michael.


reply via email to

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