Author: [EMAIL PROTECTED]
Date: Thu Sep 25 06:48:27 2008
New Revision: 379
Modified:
branches/bleeding_edge/benchmarks/base.js
branches/bleeding_edge/benchmarks/crypto.js
branches/bleeding_edge/benchmarks/earley-boyer.js
branches/bleeding_edge/benchmarks/raytrace.js
branches/bleeding_edge/benchmarks/richards.js
branches/bleeding_edge/benchmarks/run.html
branches/bleeding_edge/benchmarks/run.js
Log:
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
Modified: branches/bleeding_edge/benchmarks/base.js
==============================================================================
--- branches/bleeding_edge/benchmarks/base.js (original)
+++ branches/bleeding_edge/benchmarks/base.js Thu Sep 25 06:48:27 2008
@@ -73,7 +73,7 @@
// 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
Modified: branches/bleeding_edge/benchmarks/crypto.js
==============================================================================
--- branches/bleeding_edge/benchmarks/crypto.js (original)
+++ branches/bleeding_edge/benchmarks/crypto.js Thu Sep 25 06:48:27 2008
@@ -1674,16 +1674,23 @@
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");
+ }
}
Modified: branches/bleeding_edge/benchmarks/earley-boyer.js
==============================================================================
--- branches/bleeding_edge/benchmarks/earley-boyer.js (original)
+++ branches/bleeding_edge/benchmarks/earley-boyer.js Thu Sep 25 06:48:27
2008
@@ -4647,7 +4647,7 @@
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 @@
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");
+ }
}
}
Modified: branches/bleeding_edge/benchmarks/raytrace.js
==============================================================================
--- branches/bleeding_edge/benchmarks/raytrace.js (original)
+++ branches/bleeding_edge/benchmarks/raytrace.js Thu Sep 25 06:48:27 2008
@@ -13,6 +13,8 @@
]);
+var checkNumber;
+
// Create dummy objects if we're not running in a browser.
if (typeof document == 'undefined') {
document = { };
@@ -2669,6 +2671,13 @@
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 @@
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");
@@ -3178,6 +3191,9 @@
this.setPixel(x, y, color);
}
+ }
+ if (checkNumber !== 2321) {
+ throw new Error("Scene rendered incorrectly");
}
},
Modified: branches/bleeding_edge/benchmarks/richards.js
==============================================================================
--- branches/bleeding_edge/benchmarks/richards.js (original)
+++ branches/bleeding_edge/benchmarks/richards.js Thu Sep 25 06:48:27 2008
@@ -73,7 +73,7 @@
var msg =
"Error during execution: queueCount = " + scheduler.queueCount +
", holdCount = " + scheduler.holdCount + ".";
- print(msg);
+ throw new Error(msg);
}
}
Modified: branches/bleeding_edge/benchmarks/run.html
==============================================================================
--- branches/bleeding_edge/benchmarks/run.html (original)
+++ branches/bleeding_edge/benchmarks/run.html Thu Sep 25 06:48:27 2008
@@ -18,8 +18,10 @@
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 @@
margin-bottom: 20px;
}
-h1 {
- margin: 0px;
- font-size: 24.5px;
- height: 29.35px;
-}
-
td.contents {
text-align: start;
}
@@ -120,6 +116,30 @@
<li><b>RayTrace</b><br/>Ray tracer benchmark based on code by <a
href="http://flog.co.nz/">Adam Burmister</a> (<i>3418 lines</i>).</li>
<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">
Modified: branches/bleeding_edge/benchmarks/run.js
==============================================================================
--- branches/bleeding_edge/benchmarks/run.js (original)
+++ branches/bleeding_edge/benchmarks/run.js Thu Sep 25 06:48:27 2008
@@ -41,7 +41,7 @@
function PrintScore(score) {
print('----');
- print('Score: ' + score);
+ print('Score (version ' + BenchmarkSuite.version + '): ' + score);
}
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---