Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Mobile Safari/537.36
Chrome Mobile 121
Android
Mobile
10 months ago
Test name Executions per second
_.cloneDeep(obj) 36246.2 Ops/sec
JSON.parse(JSON.stringify(obj)) 41950.3 Ops/sec
structuredClone(obj) 42641.9 Ops/sec
_.cloneDeep(num) 879510.9 Ops/sec
JSON.parse(JSON.stringify(num)) 413144.2 Ops/sec
structuredClone(num) 141847.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • _.cloneDeep(obj)

  • JSON.parse(JSON.stringify(obj))

  • structuredClone(obj)

  • _.cloneDeep(num)

  • JSON.parse(JSON.stringify(num))

  • structuredClone(num)