Performance test

DaNiMoTh jjdanimoth at gmail.com
Wed Mar 11 17:57:54 CDT 2009


Hello to all.

I've tried to execute the same routine (see attachment) with matlab,
octave and a C program.

There are the results ( both of programs under Linux )

MatLab:
>> tic ; kernel(magic(100)) ; toc
Elapsed time is 0.052000 seconds.

Octave:
octave:1> tic ; kernel(magic(100)) ; toc
Elapsed time is 56.9406 seconds.

C:
time ./a.out
real	0m0.075s

Why this difference?
Where is the bottleneck of Octave? There is some documentation about this?

Many Thanks. ( Please CC'd me in reply as I'm not a follower of this list )

kernel.m :

function G = kernel(A)

colonne_m = size(A)(2);
righe_n = size(A)(1);

G = zeros(righe_n,righe_n);

for i = 1:righe_n
       for j = 1:colonne_m
               for k = 1:colonne_m
                       G(i,j) = G(i,j)+(A(i,k)*A(j,k));
               endfor
               G(i,j) = (G(i,j)+1)^3;
       endfor
endfor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: matrix_kernel.c
Type: application/octet-stream
Size: 1279 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090311/dffa19aa/attachment.obj 


More information about the Help-octave mailing list