Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
Chrome 73
Mac OS X 10.14.3
Desktop
5 years ago
Test name Executions per second
Lodash cloneDeep 181244.5 Ops/sec
Native map deep slice(turns objects into arrays) 2905910.5 Ops/sec
Native JSON parse 179373.5 Ops/sec
Native map deep slice at 0(turns objects into arrays) 2877798.5 Ops/sec
Native map(shallow clone) 5324514.5 Ops/sec
Recursive deep clone 172183.4 Ops/sec
Map deep clone 188323.8 Ops/sec
Object.assign shallow clone 3019112.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


;