Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
fragment append vs prepend
(version: 1)
Comparing performance of:
prepend vs append
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
const fragment = document.createDocumentFragment()
Tests:
prepend
for(let n = 1000; n--;)fragment.prepend(document.createElement("div"))
append
for(let n = 1000; n--;)fragment.append(document.createElement("div"))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
prepend
append
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Browser/OS:
Chrome Mobile 131 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
prepend
456.6 Ops/sec
append
334.2 Ops/sec
Related benchmarks:
JS: append vs appendChild
DocumentFragment vs (multiple) append
append vs fragment+appendChild
createElement vs innerHTML
createElement vs innerHTML (3000)
JavaScript: append() VS appendChild()
JS: append vs appendChild multiple nodes (10000)
appendChild with DocumentFragmenet vs append Array of Elements
createElement vs innerHTML vs innerHTML (polling) x 300
Comments
Confirm delete:
Do you really want to delete benchmark?