Speed of Octave vs. Matlab

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Speed of Octave vs. Matlab

Justin Donnelly Summer Student
I just ran the first two tests in Matlab 4.2's bench.m program on both
Octave and Matlab, and it took about 15 times as long on Octave.  Is Octave
really this slow?  Or is there some common problem which might be the cause
of this difference?



Here is the code that I'm running:

------------------------------------------
function [t] = mybench(count)
 
if nargin < 1, count = 10; end;
 
if count > 0
   t = 0;
 
   % Loops
   n = 375;
   A = [];
   r = 1;
   tic
   for k = 1:count
      for j = 1:n
         clear A;
         r = rem(pi*r,1);
         m = fix(100*r);
         A = zeros(m,m);
      end
   end
   t(1) = toc;
 
   % LU
   n = 167;
   A = rand(n,n);
   tic
   for k = 1:count
      lu(A);
   end
   t(2) = toc;
 
end
---------------------------------------


Thanks,
Justin
[hidden email]