Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JS: append vs appendChild multiple elements fwaeafwaw
(version: 1)
Comparing performance of:
append vs appendChild vs document fragment
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div id="container"></div>
Script Preparation code:
var container = document.getElementById("container"); var paragraph = document.createElement("p"); var paragraph1 = document.createElement("p"); var paragraph2 = document.createElement("p"); var paragraph3 = document.createElement("p"); let doc = document.createDocumentFragment() doc.append(paragraph,paragraph1,paragraph2,paragraph3)
Tests:
append
container.append(paragraph,paragraph1,paragraph2,paragraph3);
appendChild
container.appendChild(paragraph); container.appendChild(paragraph1); container.appendChild(paragraph2); container.appendChild(paragraph3);
document fragment
container.appendChild(doc)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
append
appendChild
document fragment
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Chrome OS 14541.0.0
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
append
49151.6 Ops/sec
appendChild
34212.4 Ops/sec
document fragment
7912162.5 Ops/sec
Related benchmarks:
JS: insertBefore vs appendChild2
JS: append vs appendChild multiple elements
JS: append vs appendChild s
JS: append vs appendChild with multiples nodes
JS: append vs appendChild for multiple children
11 JS: append vs appendChild 2zzc
JS: append vs appendChild with multiple elements
JS: append vs appendChild multi
Multiples append calls
Comments
Confirm delete:
Do you really want to delete benchmark?