octave much slower than matlab, debugging subfunctions

View: New views
2 Messages — Rating Filter:   Alert me  

octave much slower than matlab, debugging subfunctions

by John Jones :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2 things:

1. I've tried running my code in both octave and matlab and octave is significantly slower, as much as 5 times, for some operations!  Are there any tips for improving performance?

Complicated if statements are particularly slow. e.g.,

if J==1
    if E==0;
        ...
    else
    ...
        if pos<0
            ...
        elseif pos>0
           ...
        end        
    end


elseif J==2
    if (E(1)==0)||(E(2)==0)
    ...
    else
    ...
        if pos<0
            ...
        elseif pos>0
            ...
         end        
    end


Multiple while loops can take up to 3 x longer in Octave than in Matlab.



2. Debugging subfunctions

When debugging an m - file I have tried to set break points in a subfunction inside the m file. This works ok but when you run the code octave will not halt its calculation at these points. It works in Matlab. Does anyone know how to do it in Octave?


Re: octave much slower than matlab, debugging subfunctions

by Jordi GutiƩrrez Hermoso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/12/2007, John Jones <adrian_lloyd100@...> wrote:
> Multiple while loops can take up to 3 x longer in Octave than in Matlab.

This mus be the biggest performance hit that Octave newbies run into
when coming from the competition, which used to have the same problems
until they implemented  JIT compiling. The only solution so far, since
everyone seems to think that implementing JIT for Octave is ultimately
not worth the giant effort, is to write smarter code without loops
which you should be doing for Matlab anyways. If you have specific
examples on how to avoid loops, we can offer help.

Or if you have interest in implementing JIT compilation for Octave or
know someone who does, do let us know.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave