Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 68bdb17

Browse files
committed
Teach analyze.R to tolerate zeros in the benchmark output
GCC can apparently execute some benchmarks in 0.00 ns/op, probably by means of eliminating the benchmark loop. This caused problems for our R script because it takes the log of the ratio, and of course log(0) = -Inf. This change simply modifies the script to ignore zeros in its input.
1 parent 178c22c commit 68bdb17

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

utils/benchcomp/analyze.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
sc <- read.table(file('stdin'))
2+
scratio <- sc$V2 / sc$V3
3+
scratio <- scratio[scratio > 0]
24

35
# Take the log of the ratio. Our null hypothesis is a normal distribution
46
# around zero.
5-
tt <- t.test(log(sc$V2 / sc$V3))
7+
tt <- t.test(log(scratio))
68
tt
79

810
# This gives us the geo-mean as we are taking the exponent of the linear mean

0 commit comments

Comments
 (0)