Clone Vs Create element

Test speed difference between creating a small element tree repeatedly vs creating it once and cloning it.
one year ago
User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Test name Executions per second
createElement 2.4 Ops/sec
cloneNode 19.1 Ops/sec
HTML Preparation code:
Tests:
  • createElement

  • cloneNode

Open this result on MeasureThat.net