[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Performance test
From: |
DaNiMoTh |
Subject: |
Performance test |
Date: |
Wed, 11 Mar 2009 23:57:54 +0100 |
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
matrix_kernel.c
Description: Binary data
- Performance test,
DaNiMoTh <=