HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
window.foo = [{}, {a:1}, {b:1}];
Tests:
  • Lodash Filter

     
    _.filter(foo, (item) => {
      return !_.isEmpty(item);
    });
  • Native Filter

     
    foo.filter((item) => {
      return Object.keys(item).length !== 0;
    });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash Filter
    Native Filter

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0
Firefox 99 on Ubuntu
View result in a separate tab
Test name Executions per second
Lodash Filter 1279761.1 Ops/sec
Native Filter 1637315.6 Ops/sec