Author: Armin Rigo <[email protected]>
Branch:
Changeset: r209:f7abffc04667
Date: 2013-05-01 11:15 +0200
http://bitbucket.org/pypy/benchmarks/changeset/f7abffc04667/
Log: Fix for runs that only end up doing 1 iteration (e.g. hexiom2 with
--fast).
diff --git a/unladen_swallow/perf.py b/unladen_swallow/perf.py
--- a/unladen_swallow/perf.py
+++ b/unladen_swallow/perf.py
@@ -167,7 +167,10 @@
"""
assert len(sample1) == len(sample2)
error = PooledSampleVariance(sample1, sample2) / len(sample1)
- return (avg(sample1) - avg(sample2)) / math.sqrt(error * 2)
+ try:
+ return (avg(sample1) - avg(sample2)) / math.sqrt(error * 2)
+ except ZeroDivisionError:
+ return 0.0
def IsSignificant(sample1, sample2):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit