.map: Underscore.js versus jQuery (v15)

Revision 15 of this benchmark created by Kamran on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://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 (i, x) { return i*x })
ready
Underscore.js
_.map(vals, function (x, i) { return x*i })
ready
Native
vals.map(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.