From c1416bba39c669838d0fffa4b1db920d8474cc8c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 3 Jun 2012 20:35:22 -0400 Subject: [PATCH] Cleanup console messages in perf.js. Former-commit-id: b3e669d46f21d39f96873167557b4ede80458beb --- perf/perf.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perf/perf.js b/perf/perf.js index c621cd6df..2a6d080e0 100644 --- a/perf/perf.js +++ b/perf/perf.js @@ -143,8 +143,8 @@ var fastestTotalHz = Math.max(score.lodash, score.underscore), slowestTotalHz = Math.min(score.lodash, score.underscore), totalPercent = formatNumber(Math.round(((fastestTotalHz / slowestTotalHz) - 1) * 100)), - totalX = formatNumber((fastestTotalHz / slowestTotalHz).toFixed(2)), - message = ' is ' + totalPercent + '% (' + totalX + 'x) faster than '; + totalX = fastestTotalHz / slowestTotalHz, + message = ' is ' + totalPercent + '% ' + (totalX == 1 ? '' : '(' + formatNumber(totalX.toFixed(2)) + 'x) ') + 'faster than '; // report results if (score.lodash >= score.underscore) { @@ -540,6 +540,7 @@ log(Benchmark.platform + ''); } // start suites + log('\nSit back and relax, this may take a while.'); suites[0].run(); }(typeof global == 'object' && global || this));