framework (base.js), which must be loaded before any of the individual
benchmark files, and two benchmark runners: An HTML version (run.html)
and a standalone JavaScript version (run.js).
+
+
+Changes From Version 1 To Version 2
+===================================
+
+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 and the use of
+Math.random() and new Date() to build an RNG pool has been removed.
+
+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.
BenchmarkSuite.version = '2 candidate';
+// To make the benchmark results predictable, we replace Math.random
+// with a 100% deterministic alternative.
+Math.random = (function() {
+ var seed = 49734321;
+ return function() {
+ // Robert Jenkins' 32 bit integer hash function.
+ seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff;
+ seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff;
+ seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff;
+ seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;
+ seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;
+ seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff;
+ seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff;
+ return (seed & 0xfffffff) / 0x10000000;
+ };
+})();
+
+
// Runs all registered benchmark suites and optionally yields between
// each individual benchmark to avoid running for too long in the
// context of browsers. Once done, the final score is reported to the
// Mix in the current time (w/milliseconds) into the pool
function rng_seed_time() {
- rng_seed_int(new Date().getTime());
+ // Use pre-computed date to avoid making the benchmark
+ // results dependent on the current date.
+ rng_seed_int(1122926989487);
}
// Initialize the pool with junk if needed.
<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>
+<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 and the use of
+Math.random() and new Date() to build an RNG pool has been
+removed. </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">