Run details:
Mozilla/5.0 (Linux; Android 11; GM1913) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36
Chrome Mobile 112
Android
Mobile
one year ago
Test name Executions per second
Lodash cloneDeep 137150.4 Ops/sec
Native map deep slice(turns objects into arrays) 1837926.6 Ops/sec
Native JSON parse 145933.0 Ops/sec
Native map deep slice at 0(turns objects into arrays) 1838671.8 Ops/sec
Native map(shallow clone) 3826244.5 Ops/sec
Recursive deep clone 114977.3 Ops/sec
Map deep clone 125780.1 Ops/sec
Object.assign shallow clone 2029891.8 Ops/sec
Native Map with clone function (Deep) 119396.8 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

  • Native Map with clone function (Deep)