Function wrapper

Benchmark created by Miroff on


Preparation HTML

<script>
  var rfw = (function() {
    return {
      f: function(i) {
        return i;
      }
    };
  })();
  
  
  var fw = (function() {
    return function(i) {
      return i;
    }
  })();
  
  var ff = function(i) {
      return i;
      }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Wrapper
for (var i = 0; i < 10000; i++) {
  fw(i);
}
ready
Plain
for (var i = 0; i < 10000; i++) {
  ff(i);
}
ready
Rich Wrapper
for (var i = 0; i < 10000; i++) {
  rfw.f(i);
}
ready

Revisions

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