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:
7 months ago
by:
Guest
Go 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:
7 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
cloneNode
1.3M/s
createElement
411K/s
View exact numbers
Test name
Executions per second
✓
cloneNode
1,270,970 Ops/sec
createElement
411,236 Ops/sec
Related benchmarks
Clone node vs create element
cloneNode vs createElement
Create versus clone element
weweewdwr4
cloneNode vs clone function
singular clone vs batch clone
createElement vs cloneNode(true)
Comments
Confirm delete:
Do you really want to delete benchmark?