Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 OPR/74.0.3911.154
Opera 74
Linux
Desktop
3 years ago
Test name Executions per second
Lodash cloneDeep 169703.2 Ops/sec
Native map deep slice(turns objects into arrays) 2655121.2 Ops/sec
Native JSON parse 186713.0 Ops/sec
Native map deep slice at 0(turns objects into arrays) 2665620.5 Ops/sec
Recursive deep clone 157786.9 Ops/sec
Map deep clone 174772.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)

  • Recursive deep clone

  • Map deep clone