Underscore bind vs jQuery.proxy (v38)

Revision 38 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script>
<script>
var underscore = _.noConflict();
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.0.0/lodash.min.js"></script>
<script>
var lodash = _.noConflict();
</script>

Setup

var underfoo = underscore.bind(function (x) {
        return this + x;
    }, 1);
    
    var jqueryfoo = jQuery.proxy(function (x) {
        return this + x;
    }, 1);
    
    var lofoo = lodash.bind(function (x) {
        return this + x;
    }, 1);

Test runner

Ready to run.

Testing in
TestOps/sec
Underscore bind
underfoo();
ready
jQuery.proxy
jqueryfoo();
ready
Lodash bind
lofoo()
ready

Revisions

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