sdafkljfaljflkjfa

JavaScript performance comparison

Test case created by viclib

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  bla = (function() {
    return function(q) {
      for (var m = [], p = 50;50 > p;++p) {
        m[m.length] = p;
      }
      return function(h) {
        var l = h.dim, k = l[1];
        h = h.data;
        var g = {type:"image"};
        g.w = l[0];
        g.h = k;
        g.data = h;
        return g;
      }(function(h) {
        for (var l = h.dim, k = [], g = 0, n = h.dim[0] - 0;g < n;++g) {
          for (var d = g + 0, e = [], b = 0, a = h.dim[1] - 0;b < a;++b) {
            e[e.length] = [d, b + 0];
          }
          d = e;
          k;
          d;
          e = [];
          b = 0;
          for (a = k.length;b < a;++b) {
            e[b] = k[b];
          }
          b = 0;
          for (a = d.length;b < a;++b) {
            k = d[b], k, e[e.length] = k;
          }
          k = e;
        }
        g = k;
        h = [];
        n = 0;
        for (k = g.length;n < k;++n) {
          d = g[n];
          d;
          for (var e = [25, 25], b = [], a = 0, c = d.length;a < c;++a) {
            b[b.length] = d[a] - e[a];
          }
          e = b;
          d;
          for (var b = [25, 25], a = [], c = 0, f = d.length;c < f;++c) {
            a[a.length] = d[c] - b[c];
          }
          b = a;
          a = [];
          c = 0;
          for (f = e.length;c < f;++c) {
            a[a.length] = e[c] * b[c];
          }
          e = a;
          a = b = 0;
          for (c = e.length;a < c;++a) {
            f = e[a], f, b += f;
          }
          e = Math.sqrt(b);
          e = 125 + 100 * Math.sin(q + e);
          e = (e << 16) + (e << 8);
          d;
          b = [25, 25];
          a = [];
          c = 0;
          for (f = d.length;c < f;++c) {
            a[a.length] = d[c] - b[c];
          }
          b = a;
          d;
          for (var a = [25, 25], c = [], f = 0, m = d.length;f < m;++f) {
            c[c.length] = d[f] - a[f];
          }
          d = c;
          a = [];
          c = 0;
          for (f = b.length;c < f;++c) {
            a[a.length] = b[c] * d[c];
          }
          d = a;
          a = b = 0;
          for (c = d.length;a < c;++a) {
            f = d[a], f, b += f;
          }
          d = Math.sqrt(b);
          d = 125 + 100 * Math.sin(q + d);
          h[h.length] = e + d;
        }
        g = {};
        g.dim = l;
        g.data = h;
        return g;
      }(function(h) {
        var l = {dim:[50, 50]};
        l.data = h;
        return l;
      }(m)));
    };
  })();
  ble = function self(d, g, a) {
    for (var e = [], f = 0, h = d * g - 0;f < h;++f) {
      var b = f + 0, c = b % d - d / 2, b = Math.floor(b / d) - g / 2, c = Math.sqrt(c * c + b * b + 0), b = 100 + 100 * Math.sin(a + c), b = (b << 16) + (b << 8), c = 100 + 100 * Math.sin(a + c);
      e[e.length] = b + c;
    }
    a = [];
    f = 0;
    for (h = d * g - 0;f < h;++f) {
      a[a.length] = 16777215;
    }
    e = "undefined" == typeof e ? a : e;
    a = {type:"image"};
    a.w = d;
    a.h = g;
    a.data = e;
    return a;
  }
  ;
  
  bli = function self(k, l, m) {
    for (var f = [], d = k;d < l;++d) {
      f[f.length] = d;
    }
    return function(a) {
      var b = a.dim, g = b[1];
      a = a.data;
      var c = {type:"image"};
      c.w = b[0];
      c.h = g;
      c.data = a;
      return c;
    }(function(a) {
      for (var b = a.dim, g = [], c = 0, f = a.dim[0] * a.dim[1] - 0;c < f;++c) {
        var h = c + 0, d = a.dim[0], e = h % d - k / 2, h = Math.floor(h / d) - l / 2, e = Math.sqrt(0 + e * e + h * h + 0), e = 100 + 100 * Math.sin(m + e);
        g[g.length] = e;
      }
      a = {};
      a.dim = b;
      a.data = g;
      return a;
    }(function(a) {
      var b = {};
      b.dim = [k, l];
      b.data = a;
      return b;
    }(f)));
  }
  ;
  
  blo = (function() {
    return function(f, g, k) {
      for (var a = [], c = f;c < g;++c) {
        a[a.length] = c;
      }
      return function(b) {
        for (var l = b.dim, a = [], c = 0, m = b.dim[0] * b.dim[1] - 0;c < m;++c) {
          var e = c + 0, h = b.dim[0], d = e % h - f / 2, e = Math.floor(e / h) - g / 2, d = Math.sqrt(0 + d * d + e * e + 0), d = 100 + 100 * Math.sin(k + d);
          a[a.length] = d;
        }
        b = {};
        b.dim = l;
        b.data = a;
        return b;
      }(function(b) {
        var a = {};
        a.dim = [f, g];
        a.data = b;
        return a;
      }(a));
    };
  })();

};
</script>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
a
bla(5)
pending…
b
ble(50,50,5)
pending…
c
bli(50,50,5)
pending…
d
blo(50,50,5)
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