module local vs function local

Benchmark created by sabof on


Setup

function moduleLocal(a) {
      return a + 1;
    };
    
    function flTest() {
      function functionLocal(a) {
        return a + 1;
      }
      var result = 0;
      for(var i = 0; i < 1000; i++) {
        result = functionLocal(result);
      }
      return result;
    }
    
    function mlTest() {
      var result = 0;
      for(var i = 0; i < 1000; i++) {
        result = moduleLocal(result);
      }
      return result;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
module local call
mlTest();
ready
funciton local test
flTest();
ready

Revisions

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

  • Revision 1: published by sabof on