lodash vs underscore || find vs findWhere (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="https://underscorejs.org/underscore-min.js"></script>
<script>
var underscore = _;
</script>
<script src="https://cdn.jsdelivr.net/lodash/latest/lodash.min.js"></script>
<script>
var lodash= _;
</script>

Setup

var list = _.range(20000).map(function(num) {
      return {
        value: num
      };
    });
    var findThisValue = 19999;

Test runner

Ready to run.

Testing in
TestOps/sec
underscore.find
var found = underscore.find(list, function(item) {
  return item.value === findThisValue;
});
ready
underscore.findWhere
var found = underscore.findWhere(list, {
  value: findThisValue
});
ready
lodash.find
var found = lodash.find(list, function(item) {
  return item.value === findThisValue;
});
ready
lodash.findWhere
var found = lodash.findWhere(list, {
  value: findThisValue
});
ready

Revisions

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