HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.js)"></script>
Script Preparation code:
 
var obj = {
  a: 1,
  b: 2,
  c: 3,
  d: {
    a: 1
  },
  g: {
    a: {
      c: 1
    }
  }
}
Tests:
  • lodash is empty fp

     
    _.isEmpty(obj)
  • stack overflow implementation

     
    const isEmptyObj = obj => (
    obj
    && Object.keys(obj).length === 0
    && Object.getPrototypeOf(obj) === Object.prototype
    )
    isEmptyObj(obj)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash is empty fp
    stack overflow implementation

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91 on Mac OS X 10.15
View result in a separate tab
Test name Executions per second
lodash is empty fp 10416643.0 Ops/sec
stack overflow implementation 11243124.0 Ops/sec