# USOBS.m: unscientific (or unbelievably simpleminded) octave benchmark script reps = [ 1000; # create random matrix 100; # inner product 100; # invert 100; # choleski 1000 # concatenate ]; t = zeros(5,1); # create random matrix tic(); for i = 1:reps(1) a = rand(1000,1000); endfor t(1) = toc(); # inner product tic(); for i = 1:reps(2) a = rand(1000,1000); a = a'*a; endfor t(2) = toc() - t(1); # invert tic(); for i = 1:reps(3) a = rand(1000,1000); a = a'*a; a = inv(a); endfor t(3) = toc() - t(1) - t(2); # choleski tic(); for i = 1:reps(4) a = rand(1000,1000); a = a'*a; a = chol(a); endfor t(4) = toc() - t(1) - t(2); # concatenate tic(); for i = 1:reps(5) a = rand(1000,1000); a = [a zeros(1000,1000)]; endfor t(5) = toc() - t(1); version rlabels = str2mat("matrix create", "inner product", "invert", "choleski", "concatenate"); clabels = str2mat("time", "reps", "time/rep"); prettyprint([t reps t ./ reps] ,rlabels, clabels);