• Home
  • Raw
  • Download

Lines Matching +full:operations +full:- +full:per +full:- +full:run

1 #!/usr/local/bin/python -O
10 # should then be embedded in try-except clauses in the configuration
16 Copyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)
17 Copyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)
28 THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO
61 # Minimum test run-time
62 MIN_TEST_RUNTIME = 1e-3
67 # Number of calibration loops to run for each calibration run
160 test run between 20-50 seconds. This is needed because
161 clock()-timing only gives rather inaccurate values (on Linux,
166 It is also important to set the .operations variable to a
167 value representing the number of "virtual operations" done per
168 call of .run().
178 # for comparisons of benchmark runs - tests with unequal version
182 # The number of abstract operations done in each round of the
184 # measure. The benchmark will output the amount of run-time per
187 # sets of operations more than once per test round. The measured
188 # overhead per test round should be less than 1 second.
189 operations = 1 variable in Test
191 # Number of rounds to execute per test run. This should be
192 # adjusted to a figure that results in a test run-time of between
193 # 1-2 seconds.
201 # Last timing: (real, run, overhead)
213 # List of test run timings
230 raise ValueError('at least one calibration run is required')
242 self.operations = self.operations
280 t = timer() - t
294 t = timer() - t
296 - min_prep_time)
306 if max_overhead - min_overhead > 0.1:
309 '%r - %r' % (min_overhead, max_overhead))
311 def run(self): member in Test
313 """ Run the test in two phases: first calibrate, then
324 # Test run
327 t = timer() - t
331 eff_time = t - min_overhead
342 setup and run the test - except for the actual operations
351 """ Run the test.
353 The test needs to run self.rounds executing
354 self.operations number of operations each.
361 """ Return test run statistics as tuple:
363 (minimum run time,
364 average run time,
365 total run time,
366 average time per operation,
378 * self.operations)
399 # Number of benchmark rounds to run
402 # Warp factor use to run the tests
426 self.name = '%04i-%02i-%02i %02i:%02i:%02i' % \
478 print '--------------------------------------'
497 print '--------------------------------------'
509 print '-' * LINE
527 def run(self): member in Benchmark
538 print ' Round %-25i effective absolute overhead' % (i+1)
544 test.run()
555 ' ------------------------------')
567 """ Return benchmark run statistics as tuple:
588 print '-' * LINE
590 print '-' * LINE
604 print '-' * LINE
626 print '-' * LINE
649 ' minimum run-time average run-time')
652 print '-' * LINE
694 (other_min_time * other.warp) - 1.0)
696 (other_avg_time * other.warp) - 1.0)
717 print '-' * LINE
726 (other_total_min_time * compare_to.warp) - 1.0) * PERCENT)
732 (other_total_avg_time * compare_to.warp) - 1.0) * PERCENT)
753 header = ("PYBENCH - a benchmark test suite for Python "
760 options = [ArgumentOption('-n',
763 ArgumentOption('-f',
766 ArgumentOption('-c',
769 ArgumentOption('-s',
772 ArgumentOption('-w',
775 ArgumentOption('-t',
776 'run only tests with names matching arg',
778 ArgumentOption('-C',
781 SwitchOption('-d',
784 SwitchOption('-v',
787 SwitchOption('--with-gc',
790 SwitchOption('--with-syscheck',
793 ArgumentOption('--timer',
799 The normal operation is to run the suite and display the
800 results. Use -f to save them for later reuse or comparisons.
810 python2.1 pybench.py -f p21.pybench
811 python2.5 pybench.py -f p25.pybench
812 python pybench.py -s p25.pybench -c p21.pybench
818 rounds = self.values['-n']
819 reportfile = self.values['-f']
820 show_bench = self.values['-s']
821 compare_to = self.values['-c']
822 hidenoise = self.values['-d']
823 warp = int(self.values['-w'])
824 withgc = self.values['--with-gc']
825 limitnames = self.values['-t']
834 withsyscheck = self.values['--with-syscheck']
835 calibration_runs = self.values['-C']
836 timer = self.values['--timer']
838 print '-' * LINE
840 print '-' * LINE
928 bench.run()
931 print '*** KeyboardInterrupt -- Aborting'