debugging benchmark

JavaScript performance comparison

Test case created by mark

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var a, b, c;
    var d = 4;
    a = [1, 5, 9,  13,
             2, 6, 10, 14,
             3, 7, 11, 15,
             4, 8, 12, 16];
        b = [1, 5, 9,  13,
             2, 6, 10, 14,
             3, 7, 11, 15,
             4, 8, 12, 16];
    c = []
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
mult
var a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43, a44, b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34, b41, b42, b43, b44;

a11 = a[0], a12 = a[1], a13 = a[2], a14 = a[3], a21 = a[4], a22 = a[5], a23 = a[6], a24 = a[7], a31 = a[8], a32 = a[9], a33 = a[10], a34 = a[11], a41 = a[12], a42 = a[13], a43 = a[14], a44 = a[15];

b11 = b[0], b12 = b[1], b13 = b[2], b14 = b[3], b21 = b[4], b22 = b[5], b23 = b[6], b24 = b[7], b31 = b[8], b32 = b[9], b33 = b[10], b34 = b[11], b41 = b[12], b42 = b[13], b43 = b[14], b44 = b[15];

c[0] = a11 * b11 + a21 * b12 + a31 * b13 + a41 * b14;

c[1] = a12 * b11 + a22 * b12 + a32 * b13 + a42 * b14;

c[2] = a13 * b11 + a23 * b12 + a33 * b13 + a43 * b14;

c[3] = a14 * b11 + a24 * b12 + a34 * b13 + a44 * b14;

c[4] = a11 * b21 + a21 * b22 + a31 * b23 + a41 * b24;

c[5] = a12 * b21 + a22 * b22 + a32 * b23 + a42 * b24;

c[6] = a13 * b21 + a23 * b22 + a33 * b23 + a43 * b24;

c[7] = a14 * b21 + a24 * b22 + a34 * b23 + a44 * b24;

c[8] = a11 * b31 + a21 * b32 + a31 * b33 + a41 * b34;

c[9] = a12 * b31 + a22 * b32 + a32 * b33 + a42 * b34;

c[10] = a13 * b31 + a23 * b32 + a33 * b33 + a43 * b34;

c[11] = a14 * b31 + a24 * b32 + a34 * b33 + a44 * b34;

c[12] = a11 * b41 + a21 * b42 + a31 * b43 + a41 * b44;

c[13] = a12 * b41 + a22 * b42 + a32 * b43 + a42 * b44;

c[14] = a13 * b41 + a23 * b42 + a33 * b43 + a43 * b44;

c[15] = a14 * b41 + a24 * b42 + a34 * b43 + a44 * b44;
pending…
blank
for (i = _i = 0, _ref = d - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {
  for (j = _j = 0, _ref1 = d - 1; 0 <= _ref1 ? _j <= _ref1 : _j >= _ref1; j = 0 <= _ref1 ? ++_j : --_j) {
    c[i * d + j] = 0;
    for (k = _k = 0, _ref2 = d - 1; 0 <= _ref2 ? _k <= _ref2 : _k >= _ref2; k = 0 <= _ref2 ? ++_k : --_k) {
      c[i * d + j] += b[i * d + k] * a[k * d + j];
    }
  }
}
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment