Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_3_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Chrome 89
Mac OS X 11.3.1
Desktop
3 years ago
Test name Executions per second
Lodash cloneDeep 179875.0 Ops/sec
Native map deep slice(turns objects into arrays) 2735630.8 Ops/sec
Native JSON parse 183963.7 Ops/sec
Native map deep slice at 0(turns objects into arrays) 2749710.5 Ops/sec
Native map(shallow clone) 5178575.5 Ops/sec
Recursive deep clone 161559.2 Ops/sec
Map deep clone 177238.6 Ops/sec
Object.assign shallow clone 2835071.2 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


;