Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1
Mobile Safari 14
iOS 14.4
Mobile
3 years ago
Test name Executions per second
Lodash cloneDeep 82271.5 Ops/sec
Native map deep slice(turns objects into arrays) 1107830.1 Ops/sec
Native JSON parse 97817.1 Ops/sec
Native map deep slice at 0(turns objects into arrays) 1118025.2 Ops/sec
Native map(shallow clone) 1783302.8 Ops/sec
Recursive deep clone 78951.8 Ops/sec
Map deep clone 92821.7 Ops/sec
Object.assign shallow clone 1172544.9 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


;