.map: Underscore.js versus jQuery (v8)

Revision 8 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://underscorejs.org/underscore-min.js"></script>

Setup

var vals = new Array(999)
    for(var i = 0; i < vals.length; i++){vals[i] = i}

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
$.map(vals, function (x, i) { return x*i })
ready
Underscore.js
_.map(vals, function (x, i) { return x*i })
ready
Native
vals.map(function (x, i) { return x*i })
ready
_.each
_.each(vals, function (x, i) { return x*i })
ready
$.each
$.each(vals, function (x, i) { return x*i })
ready

Revisions

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