help-octave
[Top][All Lists]
Advanced

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

Re: Octave too slow runnig some instruction


From: Jaroslav Hajek
Subject: Re: Octave too slow runnig some instruction
Date: Thu, 24 Jun 2010 11:51:23 +0200

On Thu, Jun 24, 2010 at 11:38 AM, sd83 <address@hidden> wrote:
>
> Dear all,
>
> I'm working on a program and I have wrote a quite simple m-file which
> generates a random closed curve. I have runned it by octave versions 3.0.5,
> 3.2, 3.2.4 but always the same problem: too slow.
> The executing time of Octave is 35 seconds, matlab's executing time is less
> than 1 second!
> Why?
> The problem is that I will have running this functions thousands of times
> into my program!
>
> Can anyone help me?
>
> Thank you very much.
>

I assume your code looks like this (you've shown nothing, so it's a
good assumption):

if (exist ('OCTAVE_VERSION'))
  sleep (35); % it's Octave, be slow
else
  sleep (0.1); % it's Matlab, be fast
end

the solution is simple, just use 0.1 in the first branch as well. You
can even outperform Matlab by using a lower value!

:D

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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