Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/79.0.3945.117 Chrome/79.0.3945.117 Safari/537.36
Chromium 79
Linux
Desktop
4 years ago
Test name Executions per second
Lodash cloneDeep 166156.1 Ops/sec
Native map deep slice(turns objects into arrays) 2342536.8 Ops/sec
Native JSON parse 166047.3 Ops/sec
Native map deep slice at 0(turns objects into arrays) 2335894.0 Ops/sec
Recursive deep clone 146921.0 Ops/sec
Map deep clone 158592.5 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)

  • Recursive deep clone

  • Map deep clone