aboutsummaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>2009-01-16 10:38:43 +0000
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>2009-01-16 10:38:43 +0000
commit3291210ab99f306b74430ebbc4b7d939629e699f (patch)
treee1018a6d7d30a5a48b28f1ba84168cc85772d124 /benchmarks
parentaca4968107b0e84a87cee0bad8e5ca21a02e4053 (diff)
downloadv8-3291210ab99f306b74430ebbc4b7d939629e699f.tar.gz
Fixed string length bug on ARM (issue 171).
Made most methods in the API const. Optimized object literals by improving data locality. Fixed bug that caused incomplete functions to be cached in case of stack overflow exceptions. Fixed bugs that caused catch variables and variables introduced by eval to behave incorrectly when using accessors (issues 186, 190 and 191). git-svn-id: http://v8.googlecode.com/svn/trunk@1095 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/base.js27
-rw-r--r--benchmarks/run.html4
-rw-r--r--benchmarks/run.js5
3 files changed, 18 insertions, 18 deletions
diff --git a/benchmarks/base.js b/benchmarks/base.js
index 5afc110d3..6e1ff8cc7 100644
--- a/benchmarks/base.js
+++ b/benchmarks/base.js
@@ -120,7 +120,8 @@ BenchmarkSuite.RunSuites = function(runner) {
}
if (runner.NotifyScore) {
var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores);
- runner.NotifyScore(100 * score);
+ var formatted = BenchmarkSuite.FormatScore(100 * score);
+ runner.NotifyScore(formatted);
}
}
RunStep();
@@ -149,6 +150,16 @@ BenchmarkSuite.GeometricMean = function(numbers) {
}
+// Converts a score value to a string with at least three significant
+// digits.
+BenchmarkSuite.FormatScore = function(value) {
+ if (value > 100) {
+ return value.toFixed(0);
+ } else {
+ return value.toPrecision(3);
+ }
+}
+
// Notifies the runner that we're done running a single benchmark in
// the benchmark suite. This can be useful to report progress.
BenchmarkSuite.prototype.NotifyStep = function(result) {
@@ -164,7 +175,8 @@ BenchmarkSuite.prototype.NotifyResult = function() {
var score = this.reference / mean;
BenchmarkSuite.scores.push(score);
if (this.runner.NotifyResult) {
- this.runner.NotifyResult(this.name, 100 * score);
+ var formatted = BenchmarkSuite.FormatScore(100 * score);
+ this.runner.NotifyResult(this.name, formatted);
}
}
@@ -219,14 +231,3 @@ 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);
- }
-}
diff --git a/benchmarks/run.html b/benchmarks/run.html
index d521e0b37..01cadc0d2 100644
--- a/benchmarks/run.html
+++ b/benchmarks/run.html
@@ -21,7 +21,7 @@ function ShowProgress(name) {
function AddResult(name, result) {
- var text = name + ': ' + formatScore(result);
+ var text = name + ': ' + result;
var results = document.getElementById("results");
results.innerHTML += (text + "<br/>");
}
@@ -36,7 +36,7 @@ function AddError(name, error) {
function AddScore(score) {
var status = document.getElementById("status");
if (success) {
- status.innerHTML = "Score: " + formatScore(score);
+ status.innerHTML = "Score: " + score;
}
}
diff --git a/benchmarks/run.js b/benchmarks/run.js
index ecfee90c6..da2373b84 100644
--- a/benchmarks/run.js
+++ b/benchmarks/run.js
@@ -36,7 +36,7 @@ load('earley-boyer.js');
var success = true;
function PrintResult(name, result) {
- print(name + ': ' + formatScore(result));
+ print(name + ': ' + result);
}
@@ -49,8 +49,7 @@ function PrintError(name, error) {
function PrintScore(score) {
if (success) {
print('----');
- print('Score (version ' + BenchmarkSuite.version + '): '
- + formatScore(score));
+ print('Score (version ' + BenchmarkSuite.version + '): ' + score);
}
}