Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Document fragment creation cost
(version: 1)
Comparing performance of:
Reuse document fragment vs Create document fragment
Created:
11 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const container = document.createElement('div'); document.body.appendChild(container); const reusableFragment = document.createDocumentFragment();
Tests:
Reuse document fragment
const div = document.createElement('div'); reusableFragment.appendChild(div); container.appendChild(reusableFragment);
Create document fragment
const frag = document.createDocumentFragment(); const div = document.createElement('div'); frag.appendChild(div); container.appendChild(frag);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Reuse document fragment
Create document fragment
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
11 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser/OS:
Chrome 136 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Reuse document fragment
252449.6 Ops/sec
Create document fragment
216599.3 Ops/sec
Related benchmarks:
CloneNode after Append to Fragment vs Append to DOM
ssssdsaddffvfggggfffdssffff
ssssdsaddffvfggggfffdssffffdd
createElement vs innerHTML
createElement vs innerHTML (3000)
DocumentFragment vs insertAdjacentHTML
replaceChild vs replaceChildren vs documentFragment 3
replaceChildren vs document fragment
replaceChild vs replaceChildren vs documentFragment more nodes
Comments
Confirm delete:
Do you really want to delete benchmark?