From: <sch...@us...> - 2011-05-04 15:32:34
|
Revision: 8243 http://octave.svn.sourceforge.net/octave/?rev=8243&view=rev Author: schloegl Date: 2011-05-04 15:32:27 +0000 (Wed, 04 May 2011) Log Message: ----------- performance test of some core functions of the NaN-toolbox Added Paths: ----------- trunk/octave-forge/extra/NaN/test/test_perf_skipnan.m Added: trunk/octave-forge/extra/NaN/test/test_perf_skipnan.m =================================================================== --- trunk/octave-forge/extra/NaN/test/test_perf_skipnan.m (rev 0) +++ trunk/octave-forge/extra/NaN/test/test_perf_skipnan.m 2011-05-04 15:32:27 UTC (rev 8243) @@ -0,0 +1,57 @@ + +%% TEST_PERF_NANTB + +% $Id$ +% Copyright (C) 2009,2010 by Alois Schloegl <alo...@gm...> +% This function is part of the NaN-toolbox +% http://pub.ist.ac.at/~schloegl/matlab/NaN/ + +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +% USA + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Performance +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SUMSKIPNAN_MEX with and w/o OpenMP +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Generate Test data +y = randn(1e7,32); + +flag=0; +N = 10; % repeat the tests 10 times +t1=repmat(N,2); +t2=repmat(N,2); +for k=1:N; + tic;t=cputime(); + [s,n]=sumskipnan_mex(y,1); + t1(k,1)=cputime()-t; t1(k,2)=toc; + + tic;t=cputime(); + [c,n]=covm_mex(y,[],flag); + t2(k,1)=cputime()-t; t2(k,2)=toc; +end; +[[t1,t2];mean([t1,t2]);std([t1,t2])] +exp(-diff(log([mean(t1)',mean(t2)']))) + + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |