Sibling functions vs nested functions (v7)

Revision 7 of this benchmark created on


Setup

function sibs() {
    var siblings = {
      foo: function() {},
      bar: function() {
        this.foo();
      }
    };
    for(var i = 0; i<1000;++i){
      siblings.bar();
    }
  }
  
  function nests() {
    var nested = {
      bar: function() {
        var foo = function() {};
        foo();
      }
    };
    for(var i = 0; i<1000;++i){
      nested.bar();
    }
  }

Test runner

Ready to run.

Testing in
TestOps/sec
Siblings
sibs();
ready
Nested
nests();
ready

Revisions

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