Commit 806c4d63 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Introduce some checks to indicate that the benchmarks have run correctly.

This change affects the results by around 2% so the version number has been
bumped to 2 to avoid confusion.
Review URL: http://codereview.chromium.org/4401

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 83da47e0
......@@ -73,7 +73,7 @@ BenchmarkSuite.suites = [];
// Scores are not comparable across versions. Bump the version if
// you're making changes that will affect that scores, e.g. if you add
// a new benchmark or change an existing one.
BenchmarkSuite.version = '1';
BenchmarkSuite.version = '2 candidate';
// Runs all registered benchmark suites and optionally yields between
......
......@@ -1674,16 +1674,23 @@ coeffValue="3a3e731acd8960b7ff9eb81a7ff93bd1cfa74cbd56987db58b4594fb09c09084db17
setupEngine(am3, 28);
var RSA = new RSAKey();
var TEXT = "The quick brown fox jumped over the extremely lazy frogs!";
RSA.setPublic(nValue, eValue);
RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
var TEXT = "The quick brown fox jumped over the extremely lazy frog! " +
"Now is the time for all good men to come to the party.";
var encrypted;
function encrypt() {
return RSA.encrypt(TEXT);
var RSA = new RSAKey();
RSA.setPublic(nValue, eValue);
RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
encrypted = RSA.encrypt(TEXT);
}
function decrypt() {
return RSA.decrypt(TEXT);
var RSA = new RSAKey();
RSA.setPublic(nValue, eValue);
RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
var decrypted = RSA.decrypt(encrypted);
if (decrypted != TEXT) {
throw new Error("Crypto operation failed");
}
}
......@@ -4647,7 +4647,7 @@ var const_earley;
return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() {
return (test(k));
}, function(result) {
return ((sc_display(result)), (sc_newline()), true);
return ((sc_display(result)), (sc_newline()), result == 132);
})));
};
}
......@@ -4675,6 +4675,9 @@ SC_ERROR_OUT = SC_DEFAULT_OUT;
function RunBenchmark(name, count, run, warn) {
for (var n = 0; n < count; ++n) {
result = run();
if (!warn(result)) {
throw new Error("Earley or Boyer did incorrect number of rewrites");
}
}
}
......
......@@ -13,6 +13,8 @@ var RayTrace = new BenchmarkSuite('RayTrace', 932666, [
]);
var checkNumber;
// Create dummy objects if we're not running in a browser.
if (typeof document == 'undefined') {
document = { };
......@@ -2669,6 +2671,13 @@ Flog.RayTracer.Color.prototype = {
return result;
},
brightness : function() {
var r = Math.floor(this.red*255);
var g = Math.floor(this.green*255);
var b = Math.floor(this.blue*255);
return (r * 77 + g * 150 + b * 29) >> 8;
},
toString : function () {
var r = Math.floor(this.red*255);
var g = Math.floor(this.green*255);
......@@ -3152,11 +3161,15 @@ Flog.RayTracer.Engine.prototype = {
this.canvas.fillStyle = color.toString();
this.canvas.fillRect (x * pxW, y * pxH, pxW, pxH);
} else {
if (x === y) {
checkNumber += color.brightness();
}
// print(x * pxW, y * pxH, pxW, pxH);
}
},
renderScene: function(scene, canvas){
checkNumber = 0;
/* Get canvas */
if (canvas) {
this.canvas = canvas.getContext("2d");
......@@ -3179,6 +3192,9 @@ Flog.RayTracer.Engine.prototype = {
this.setPixel(x, y, color);
}
}
if (checkNumber !== 2321) {
throw new Error("Scene rendered incorrectly");
}
},
getPixelColor: function(ray, scene){
......
......@@ -73,7 +73,7 @@ function runRichards() {
var msg =
"Error during execution: queueCount = " + scheduler.queueCount +
", holdCount = " + scheduler.holdCount + ".";
print(msg);
throw new Error(msg);
}
}
......
......@@ -18,8 +18,10 @@ hr{
margin:1em 0
}
h1,h2,h3,h4{margin-bottom:0}
h1{font-size:160%}
h1,h2,h3,h4{margin:0; margin-bottom:0}
h1{font-size: 200%; height: 2em}
h2{font-size: 140%; height: 2em}
h3{font-size: 100%; height: 2em}
li{
margin:.3em 0 1em 0;
......@@ -41,12 +43,6 @@ div.title {
margin-bottom: 20px;
}
h1 {
margin: 0px;
font-size: 24.5px;
height: 29.35px;
}
td.contents {
text-align: start;
}
......@@ -121,6 +117,30 @@ higher scores means better performance: <em>Bigger is better!</em>
<li><b>EarleyBoyer</b><br/>Classic Scheme benchmarks, translated to JavaScript by Florian Loitsch's Scheme2Js compiler (<i>4682 lines</i>).</li>
</ul>
<div class="title"><h2>Revisions of the benchmark suite</h2></div>
<p><i>Please note that benchmark results are not comparable unless both
results are run with the same revision of the benchmark suite. We will be
making revisions from time to time in order to fix bugs or expand the scope
of the benchmark suite.</i></p>
<div class="title"><h3>Version 1</h3></div>
<p>Initial release.</p>
<div class="title"><h3>Version 2</h3></div>
<p>For version 2 the crypto benchmark was fixed. Previously, the decryption
stage was given plaintext as input, which resulted in an error. Now, the
decryption stage is given the output of the encryption stage as input. The
result is checked against the original plaintext. For this to give the correct
results the crypto objects are reset for each iteration of the benchmark. In
addition, the size of the plain text has been increased a little.</p>
<p>Other benchmarks were fixed to do elementary verification of the results of
their calculations. This is to avoid accidentally obtaining scores that are
the result of an incorrect JavaScript engine optimization.</p>
</td><td style="text-align: center">
<div class="run">
<div id="status" style="text-align: center; margin-top: 75px; font-size: 120%; font-weight: bold;">Starting...</div>
......
......@@ -41,7 +41,7 @@ function PrintResult(name, result) {
function PrintScore(score) {
print('----');
print('Score: ' + score);
print('Score (version ' + BenchmarkSuite.version + '): ' + score);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment