HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
var o = {
 a: {
   b: 1,
   c: 2,
   d: 3,
   j: {
     k: [1,2,3],
     l: [4,5,6]
   },
 },
 e: [1,2,3,4,5,6],
 f: 1,
 g: {
   h: 1,
 }
}
Tests:
  • Lodash cloneDeep

     
    const a = _.cloneDeep(o)
  • JSON PARSE JSON STRINGIFY

     
    const a = JSON.parse(JSON.stringify(o))
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash cloneDeep
    JSON PARSE JSON STRINGIFY

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Mobile Safari/537.36
Chrome Mobile 107 on Android
View result in a separate tab
Test name Executions per second
Lodash cloneDeep 127346.7 Ops/sec
JSON PARSE JSON STRINGIFY 143338.4 Ops/sec