Chromium Code Reviews| Index: benchmarks/base.js |
| diff --git a/benchmarks/base.js b/benchmarks/base.js |
| index 2c26132f7cd6354be98611f449b040beb65e2305..5afc110d3ffa8992b9c5833f90603b67a4b358dd 100644 |
| --- a/benchmarks/base.js |
| +++ b/benchmarks/base.js |
| @@ -120,7 +120,7 @@ BenchmarkSuite.RunSuites = function(runner) { |
| } |
| if (runner.NotifyScore) { |
| var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores); |
| - runner.NotifyScore(Math.round(100 * score)); |
|
sandholm
2008/12/02 12:54:16
Just wondering if it would make sense to always si
|
| + runner.NotifyScore(100 * score); |
| } |
| } |
| RunStep(); |
| @@ -164,7 +164,7 @@ BenchmarkSuite.prototype.NotifyResult = function() { |
| var score = this.reference / mean; |
| BenchmarkSuite.scores.push(score); |
| if (this.runner.NotifyResult) { |
| - this.runner.NotifyResult(this.name, Math.round(100 * score)); |
| + this.runner.NotifyResult(this.name, 100 * score); |
| } |
| } |
| @@ -219,3 +219,14 @@ BenchmarkSuite.prototype.RunStep = function(runner) { |
| } |
| return RunNext(); |
| } |
| + |
| + |
| +// Converts a score value to a string with at least three significant |
| +// digits. |
| +function formatScore(value) { |
| + if (value > 100) { |
| + return value.toFixed(0); |
| + } else { |
| + return value.toPrecision(3); |
| + } |
| +} |