diff options
author | ncteisen <ncteisen@gmail.com> | 2017-06-19 14:30:33 -0700 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2017-06-19 14:31:04 -0700 |
commit | 65fe1abed281fd911382d40fca72d79c14e9960a (patch) | |
tree | e5cf630805d30e3d6ffe54203dfd808d54cb4de9 /tools/profiling | |
parent | 3345e1ccf766d813dcd0f07324214cf623725ff0 (diff) |
Address github comments
Diffstat (limited to 'tools/profiling')
-rwxr-xr-x | tools/profiling/microbenchmarks/bm_diff/bm_speedup.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py b/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py index 4bf59fb280..63e691af02 100755 --- a/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_speedup.py @@ -17,6 +17,7 @@ from scipy import stats import math +_DEFAULT_THRESHOLD = 1e-10 def scale(a, mul): return [x * mul for x in a] @@ -26,7 +27,7 @@ def cmp(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 s0, p0 = cmp(new, old) if math.isnan(p0): return 0 @@ -52,6 +53,6 @@ def speedup(new, old, threshold): if __name__ == "__main__": new = [0.0, 0.0, 0.0, 0.0] - old=[2.96608e-06, 3.35076e-06, 3.45384e-06, 3.34407e-06] + old = [2.96608e-06, 3.35076e-06, 3.45384e-06, 3.34407e-06] print speedup(new, old, 1e-5) print speedup(old, new, 1e-5) |