Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:86.0) Gecko/20100101 Firefox/86.0
Firefox 86
Mac OS X 10.16
Desktop
3 years ago
Test name Executions per second
Lodash cloneDeep 124575.0 Ops/sec
Native map deep slice(turns objects into arrays) 8413181.0 Ops/sec
Native JSON parse 208879.9 Ops/sec
Native map deep slice at 0(turns objects into arrays) 8556513.0 Ops/sec
Native map(shallow clone) 18156886.0 Ops/sec
Recursive deep clone 480635.3 Ops/sec
Map deep clone 480352.7 Ops/sec
Object.assign shallow clone 9560299.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


;