lazy-demo (v12)

Revision 12 of this benchmark created by jdochen on


Preparation HTML

<script src="https://cdn.rawgit.com/lodash/lodash/3.0.0/lodash.js"></script>

Setup

var arr = _.range(100000),
        limit = 100;
        
    var odd = function(v) { return !!(v % 2); },
        square = function(v) { return v * v; };

Test runner

Ready to run.

Testing in
TestOps/sec
regular
var r = _.filter(_.map(arr, square), odd);
 
ready
lazy
var r = _(arr).map(square).filter(odd).value();
 
ready

Revisions

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