This updates pybench for Python 2.6 with the fixes found in Python 2.7's
version.
--- Python-2.6.4/Tools/pybench/pybench.py.orig Wed Nov 2 17:09:28 2011
+++ Python-2.6.4/Tools/pybench/pybench.py Sat Jun 11 08:46:28 2011
@@ -1,4 +1,4 @@
+#!/usr/local/bin/python -O
""" A Python Benchmark Suite
@@ -230,7 +230,7 @@
raise ValueError('at least one calibration run is required')
self.calibration_runs = calibration_runs
if timer is not None:
- timer = timer
+ self.timer = timer
# Init variables
self.times = []
@@ -278,7 +278,7 @@
for i in calibration_loops:
pass
t = timer() - t
- prep_times.append(t)
+ prep_times.append(t / CALIBRATION_LOOPS)
min_prep_time = min(prep_times)
if _debug:
print
@@ -689,7 +689,7 @@
other_total_avg_time = other_total_avg_time + other_avg_time
if (benchmarks_compatible and
test.compatible(other)):
- # Both benchmark and tests are comparible
+ # Both benchmark and tests are comparable
min_diff = ((min_time * self.warp) /
(other_min_time * other.warp) - 1.0)
avg_diff = ((avg_time * self.warp) /
@@ -703,7 +703,7 @@
else:
avg_diff = '%+5.1f%%' % (avg_diff * PERCENT)
else:
- # Benchmark or tests are not comparible
+ # Benchmark or tests are not comparable
min_diff, avg_diff = 'n/a', 'n/a'
tests_compatible = 0
print '%30s: %5.0fms %5.0fms %7s %5.0fms %5.0fms %7s' % \