function calls: direct, wrap, fp

JavaScript performance comparison

Revision 61 of this test case created by

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var func = function() {
        return this;
      },
      context = {
        f: 'text'
      };
  
  var bind = Function.prototype.call.bind(Function.prototype.bind);
  var bind2 = function (func, context) {
    if (arguments.length > 2) {
        return func.bind.apply(func, Array.prototype.slice.call(arguments, 1));
    } else {
        return func.bind(context);
    }
  };

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
native bind
func.bind(context);
pending…
fp
bind(func, context);
pending…
wrapped
bind2(func, context);
pending…

Compare results of other browsers

Revisions

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

0 Comments