Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Firefox 108
Windows 7
Desktop
one year ago
Test name Executions per second
Lodash cloneDeep 137307.8 Ops/sec
Native map deep slice(turns objects into arrays) 7961090.0 Ops/sec
Native JSON parse 256874.9 Ops/sec
Native map deep slice at 0(turns objects into arrays) 7697439.0 Ops/sec
Native map(shallow clone) 20983666.0 Ops/sec
Recursive deep clone 719635.5 Ops/sec
Map deep clone 722087.8 Ops/sec
Object.assign shallow clone 11951443.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Lodash cloneDeep

  • Native map deep slice(turns objects into arrays)

  • Native JSON parse

  • Native map deep slice at 0(turns objects into arrays)

  • Native map(shallow clone)

  • Recursive deep clone

  • Map deep clone

  • Object.assign shallow clone


;