scope vs property (v2)

Revision 2 of this benchmark created by tenbits on


Test runner

Ready to run.

Testing in
TestOps/sec
scope
var app = {};

app.module = (function(win, undefined) {

 return {
  initalize: function() {
   win.counter = win.counter ? win.counter + 1 : 0;
  }

 };

})(this, this.undefined);

app.module.initalize();
ready
property
var app = {};

app.module = (function(win, undefined) {

 return {
  initalize: function() {
   this.counter = this.counter ? this.counter + 1 : 0;
  }

 };

})(this, this.undefined);

app.module.initalize();
ready

Revisions

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