Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36
Chrome 103
Linux
Desktop
2 years ago
Test name Executions per second
Lodash cloneDeep 170763.5 Ops/sec
Native map deep slice(turns objects into arrays) 2665261.2 Ops/sec
Native JSON parse 204247.9 Ops/sec
Native map deep slice at 0(turns objects into arrays) 2598963.5 Ops/sec
Native map(shallow clone) 5079274.5 Ops/sec
Recursive deep clone 148563.9 Ops/sec
Map deep clone 153559.5 Ops/sec
Object.assign shallow clone 2833305.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


;