Underscore bind vs jQuery.proxy (v30)

Revision 30 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>

Test runner

Ready to run.

Testing in
TestOps/sec
Underscore bind
var foo = underscore.bind(function (x) {
    return this + x;
}, 1);
ready
jQuery.proxy
var foo = jQuery.proxy(function (x) {
    return this + x;
}, 1);
ready
Lodash bind
var foo = lodash.bind(function (x) {
    return this + x;
}, 1);
ready
With global
var that = 1;
var foo = function(x) {
    return that + x;
}
ready

Revisions

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