Address github comments

pull/11510/head
ncteisen 8 years ago
parent 3345e1ccf7
commit 65fe1abed2
  1. 3
      tools/profiling/microbenchmarks/bm_diff/bm_speedup.py

@ -17,6 +17,7 @@
from scipy import stats from scipy import stats
import math import math
_DEFAULT_THRESHOLD = 1e-10
def scale(a, mul): def scale(a, mul):
return [x * mul for x in a] return [x * mul for x in a]
@ -26,7 +27,7 @@ def cmp(a, b):
return stats.ttest_ind(a, b) return stats.ttest_ind(a, b)
def speedup(new, old, threshold): def speedup(new, old, threshold = _DEFAULT_THRESHOLD):
if (len(set(new))) == 1 and new == old: return 0 if (len(set(new))) == 1 and new == old: return 0
s0, p0 = cmp(new, old) s0, p0 = cmp(new, old)
if math.isnan(p0): return 0 if math.isnan(p0): return 0

Loading…
Cancel
Save