HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js'></script>
Tests:
  • Lodash

    x
     
    const a = {test:{val:[1]}}
    const b = _.cloneDeep(a);
    b.test.val[0] = 2;
    if(a.test.val[0] === b.test.val[0] ){
      throw new Error("Shallow Cloned")
    }
  • JSON.stringify.parse

     
    const a = {test:{val:[1]}}
    const b = JSON.parse(JSON.stringify(a))
    b.test.val[0] = 2;
    if(a.test.val[0] === b.test.val[0] ){
      throw new Error("Shallow Cloned")
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash
    JSON.stringify.parse

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0
Firefox 106 on Mac OS X 10.15
View result in a separate tab
Test name Executions per second
Lodash 1297234.8 Ops/sec
JSON.stringify.parse 2321556.0 Ops/sec