lazy-demo (v10)

Revision 10 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 p = [
       {value: 4}, {value: 21},
       {value: 12}, {value: 3},
       {value: 7}, {value: 9},
       {value: 32}, {value: 0},
       {value: 10}, {value: 32},
       {value: 7}, {value: 9},
       {value: 32}, {value: 0},
       {value: 10}, {value: 32},
       {value: 34}, {value: 20}
    ];
    
    function lt10 (item) {
        return item.value <= 10
    }

Test runner

Ready to run.

Testing in
TestOps/sec
regular
var ret = _.take(_.filter(lt10), 2)
ready
lazy
var ret = _(p).filter(lt10).take(2).value()
ready

Revisions

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