Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Chrome 125
Linux
Desktop
4 months ago
Test name Executions per second
Spread operator (...) 2725087.2 Ops/sec
JSON.parse(JSON.stringify()) 246551.0 Ops/sec
Custom function 474015.2 Ops/sec
Lodash.cloneDeep() 253799.1 Ops/sec
jQuery.extend(true) 340249.9 Ops/sec
structuredClone() 212233.8 Ops/sec
HTML Preparation code:
Tests:
  • Spread operator (...)

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)

  • structuredClone()