#! /usr/bin/env perl # experiment 00: reliably measure average performance for all hits (by doing a # large number of repetitions, 20 by default); results are simply printed do "../common.pl"; # test parameters $ntries = 1; # do different filtering to avoid outliers $nruns = 30; $nclamp = 1; # clamped from both ends init_exp(); #output file $nhits = $max_nhits; @avg_times = (); for($irun = 0; $irun < $nruns; $irun++) { run_test(); $avg_times[$irun] = $avg_time; } @avg_times = sort @avg_times; #print @avg_times; $avg_time = 0; for($irun = $nclamp; $irun < $nruns - $nclamp; $irun++) { $avg_time += $avg_times[$irun]; } $avg_time /= $nruns - 2 * $nclamp; $perf = $nhits / $avg_time * 1e-6; $str = sprintf "%d tries, %d clamp, time %6.2lf ms, performance %6.2lf MHit/s\n", $nruns, $nclamp, $avg_time * 1000, $perf; printf "%s", $str;