Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
Firefox 116
Windows
Desktop
8 months ago
Test name Executions per second
Lodash cloneDeep 236542.4 Ops/sec
Native map deep slice(turns objects into arrays) 13592320.0 Ops/sec
Native JSON parse 421283.3 Ops/sec
Native map deep slice at 0(turns objects into arrays) 11983730.0 Ops/sec
Native map(shallow clone) 34294220.0 Ops/sec
Recursive deep clone 2200980.0 Ops/sec
Map deep clone 2245761.0 Ops/sec
Object.assign shallow clone 23228070.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