HTML Preparation code:
AخA
 
1
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
Script Preparation code:
x
 
window.obj = {};
for (var i = 0, len = 1001; i < len; i++) {
  var arr = []
  obj['key' + i] = arr
  for (var n = 0, len = 1001; n < len; n++) {
    arr.push({ ['key' + n]: n });
  }
}
Tests:
  • Lodash

     
    _.reduce(obj, (acc, val, key) => {
      acc[key] = val.map(d => ({ label: key, value: val }));
      return acc;
    }, {})
  • Native

     
    Object.entries(obj).reduce((acc, [key, val]) => {
      acc[key] = val.map(d => ({ label: key, value: val }));
      return acc;
    }, {})
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash
    Native

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Linux; Android 10; POCO F1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36
Chrome Mobile 85 on Android
View result in a separate tab
Test name Executions per second
Lodash 30.1 Ops/sec
Native 24.9 Ops/sec