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:
 
var MyObject = [[1,2,3],[1,2,3],[1,2,3]];
var myCopy = null;
Tests:
  • Lodash cloneDeep

     
    myCopy = _.cloneDeep(MyObject);
  • Json clone

     
    myCopy = JSON.parse(JSON.stringify(MyObject));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash cloneDeep
    Json clone

    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:91.0) Gecko/20100101 Firefox/91.0
Firefox 91 on Ubuntu
View result in a separate tab
Test name Executions per second
Lodash cloneDeep 335733.8 Ops/sec
Json clone 475195.1 Ops/sec