Native bind vs jQuery.proxy vs Lodash bind vs Without bind (v82)

Revision 82 of this benchmark created on


Preparation HTML

<script src="//code.jquery.com/jquery-2.1.1.min.js">
</script>
<script src="//rawgit.com/lodash/lodash/master/lodash.js">
</script>

Setup

this.__num = 1;
    
    var nativeBind = (function(x) {
      return this.__num + x;
    }).bind(this);
    
    var jqProxy = jQuery.proxy(function(x) {
      return this.__num + x;
    }, this);
    
    var lodashBind = _.bind(function(x) {
      return this.__num + x;
    }, this);
    
    var that = this;
    var withoutBind = function(x) {
      return that.__num + x;
    };

Test runner

Ready to run.

Testing in
TestOps/sec
Native bind
nativeBind(1);
ready
jQuery.proxy
jqProxy(1);
ready
Underscore.js bind
lodashBind(1);
ready
Without bind
withoutBind(1);
ready

Revisions

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