aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/profiling
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-05 06:34:07 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-05 06:34:07 -0700
commitd6d2da11492f52a4170be34c826f6adb8ca837d1 (patch)
tree2b9e4c426efdc55f5d9e7b5c386ad2ffc754ab55 /tools/profiling
parente749e34f07be72b9f804039d1210b4ca5b045026 (diff)
Handle nans
Diffstat (limited to 'tools/profiling')
-rw-r--r--tools/profiling/microbenchmarks/speedup.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/profiling/microbenchmarks/speedup.py b/tools/profiling/microbenchmarks/speedup.py
index ac268fb679..a06f2a91e1 100644
--- a/tools/profiling/microbenchmarks/speedup.py
+++ b/tools/profiling/microbenchmarks/speedup.py
@@ -28,6 +28,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from scipy import stats
+import math
_THRESHOLD = 0.01
@@ -39,6 +40,7 @@ def cmp(a, b):
def speedup(new, old):
s0, p0 = cmp(new, old)
+ if math.isnan(p0) return 0
if s0 == 0: return 0
if p0 > _THRESHOLD: return 0
if s0 < 0: