Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3499)

Unified Diff: benchmarks/base.js

Issue 12865: Benchmark precision (Closed)
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | benchmarks/run.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
+}
« no previous file with comments | « no previous file | benchmarks/run.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698