diff options
author | Alexander Early <alexander.early@gmail.com> | 2015-05-20 21:18:59 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2015-05-20 21:18:59 -0700 |
commit | c8ed5ee14699f95c80a556b2fc667a96036e7bf1 (patch) | |
tree | d352d5a9e40545e8fb1cda36d90238f5b68e8ab5 | |
parent | 501ad1ff4dc339e819c913ceb0249d4a41e58fee (diff) | |
download | async-c8ed5ee14699f95c80a556b2fc667a96036e7bf1.tar.gz |
improved benchmark conclusions [ci skip]
-rwxr-xr-x | perf/benchmark.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/perf/benchmark.js b/perf/benchmark.js index f78ae04..d69243a 100755 --- a/perf/benchmark.js +++ b/perf/benchmark.js @@ -55,6 +55,9 @@ async.eachSeries(versionNames, cloneVersion, function (err) { var totalTime0 = Math.round(totalTime[version0]); var totalTime1 = Math.round(totalTime[version1]); + var wins0 = Math.round(wins[version0]); + var wins1 = Math.round(wins[version1]); + if ( Math.abs((totalTime0 / totalTime1) - 1) < 0.01) { // if < 1% difference, we're likely within the margins of error console.log("Both versions are about equal " + @@ -66,6 +69,17 @@ async.eachSeries(versionNames, cloneVersion, function (err) { console.log(version1 + " faster overall " + "(" + totalTime1 + "ms total vs. " + totalTime0 + "ms total)"); } + + if (wins0 > wins1) { + console.log(version0 + " won more benchmarks " + + "(" + wins0 + " vs. " + wins1 + ")"); + } else if (wins1 > wins0) { + console.log(version1 + " won more benchmarks " + + "(" + wins1 + " vs. " + wins0 + ")"); + } else { + console.log("Both versions won the same number of benchmarks " + + "(" + wins0 + " vs. " + wins1 + ")"); + } }); }); |