function calls: direct, wrap, fp (v61)

Revision 61 of this benchmark created on


Setup

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);
      }
    };

Test runner

Ready to run.

Testing in
TestOps/sec
native bind
func.bind(context);
ready
fp
bind(func, context);
ready
wrapped
bind2(func, context);
ready

Revisions

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