Compare loop (v3)

Revision 3 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Compare loop
var test = {
  x: 5,
  y: [],
  faster: function() {
    var i = 0,
        res = 0;
    for (; i < 7000; i++) {
      this.y.push(i);
    }
    for (i = 0; i < this.y.length; i++) {
      res += this.x * this.y;
    }
    return res;
  }
};
test.faster();
ready
Compare loop
var test = {
  x: 5,
  y: [],
  faster: function() {
    var i = 0,
        res = 0,
        me = this;
    for (; i < 7000; i++) {
      me.y.push(i);
    }
    for (i = 0; i < me.y.length; i++) {
      res += me.x * me.y;
    }
    return res;
  }
};
test.faster();
ready

Revisions

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