octave-maintainers
[Top][All Lists]
Advanced

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

Re: Speed of Ocave vs Matlab?


From: Markus Bergholz
Subject: Re: Speed of Ocave vs Matlab?
Date: Tue, 8 Sep 2015 00:03:50 +0200



On Mon, Sep 7, 2015 at 11:14 PM, Michael Barnes <address@hidden> wrote:
I just got asked this question at a computer vision conference. Does anyone have any benchmark examples I can quote?

Thanks

Michael Barnes


function ret = e3(n)
    % calculating e, because matlab doesn't have it
    if (nargin == 0)
        n = 1000;
    end
    ret = cumsum([ 1 1./factorial(1:n)]);
    ret = ret(end);
end

Matlab: 0.00068 sec
Octave: 0.00045 sec


>> size(data)
ans =
        3401          15

>> tic, a = str2double(data); toc % this is matlab
Elapsed time is 1.999473 seconds.

octave:2> tic, a = str2double(data); toc % this is octave
Elapsed time is 0.122138 seconds.



It always depends on your code and data structure. When you're benchmarking loops, octave will lose.

PS: don't trust any benchmarks


--
icq: 167498924
XMPP|Jabber: address@hidden

reply via email to

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