closures vs no closures - no BS version (v2)

Revision 2 of this benchmark created by Angus Croll on


Setup

(function() {
      var x = document, y = {a:3,b:4,c:5,d:6,e:7};
      (function() {
        (function() {
          (function() {
            (function() {
              (function() {
                (function() {
                  (function() {
                    window.closure = function() {
                      console.log(x,y);
                    };
                  })();
                })();
              })();
            })();
          })();
        })();
      })();
    })();
    
    function noClosure() {
      var x = document, y = {a:3,b:4,c:5,d:6,e:7};
      console.log(x,y);
    }

Test runner

Ready to run.

Testing in
TestOps/sec
closure
window.closure();
ready
no closure
noClosure()
ready

Revisions

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

  • Revision 2: published by Angus Croll on