lazy-demo (v8)

Revision 8 of this benchmark created on


Preparation HTML

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

Setup

var arr = _.range(10000),
        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 = _.take(_.filter(_.map(arr, square), odd), 100);
 
ready
lazy
var r = _(arr).map(square).filter(odd).take(100).value();
 
ready

Revisions

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