HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/npm/lodash@1.3.1/lodash.min.js"></script>
Script Preparation code:
 
var items = [ ...Array(10000).keys() ].map( i => { return { bar: "foo" } });
Tests:
  • Lodash cloneDeep

     
    _.cloneDeep(items);
  • JSON parse/stringify

     
    JSON.parse(JSON.stringify(items));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash cloneDeep
    JSON parse/stringify

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Chrome 118 on Windows
View result in a separate tab
Test name Executions per second
Lodash cloneDeep 13.3 Ops/sec
JSON parse/stringify 720.5 Ops/sec