Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
createElement vs cloneNode.
(version: 1)
Comparing performance of:
createElement vs cloneNode
Created:
4 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
const arr = []; const cloned = document.createElement('button'); Object.assign(cloned, { type: 'button', style: '--example: asd', textContent: 'Example' });
Tests:
createElement
const created = document.createElement('button'); Object.assign(created, { type: 'button', style: '--example: asd', textContent: 'Example' }); arr.push(created);
cloneNode
arr.push(cloned.cloneNode(true));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
createElement
cloneNode
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser/OS:
Chrome 143 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
createElement
411235.9 Ops/sec
cloneNode
1270970.1 Ops/sec
Related benchmarks:
Clone node vs create element
clone vs inner
cloneNode vs createElement
Create versus clone element
createElement vs cloneNode customcustomcustomcustom
weweewdwr4
cloneNode vs clone function
singular clone vs batch clone
createElement vs cloneNode(true)
Comments
Confirm delete:
Do you really want to delete benchmark?