help-octave
[Top][All Lists]
Advanced

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

speed of octave


From: frank wang
Subject: speed of octave
Date: Thu, 6 Sep 2007 14:41:53 -0700

while trying to find the speed of octave, scilab and matlab, I found
the following test code and decided to run it on octave 2.9.13
(window) and matlab 7.1a. The result shows that octave is 30 time
slower than matlab.

in Matlabe: tic; z=bench1(10); toc;
Elapsed time is 0.015060 seconds.

in octave: tic; z=bench1(10); toc;
Elapsed time is 2.704300 seconds.

function [z]=bench1(n)
for i=1:n,
    for j=1:1000,
        z=log(j);
        z1=log(j+1);
        z2=log(j+2);
        z3=log(j+3);
        z4=log(j+4);
        z5=log(j+5);
        z6=log(j+6);
        z7=log(j+7);
        z8=log(j+8);
        z9=log(j+9);
    end
end
z = z9;

Thanks

Frank


reply via email to

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