Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
appendChild vs append vs map/append vs DocumentFragment
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
append
257K/s
appendChild
254K/s
map/append
217K/s
DocumentFragment
200K/s
View exact numbers
Test name
Executions per second
✓
append
257,362 Ops/sec
appendChild
253,557 Ops/sec
map/append
216,507 Ops/sec
DocumentFragment
200,347 Ops/sec
Tests:
appendChild
const ul = document.createElement('ul'); for (const d of '123456') { const li = document.createElement('li'); li.textContent = d; ul.appendChild(li); }
append
const ul = document.createElement('ul'); for (const d of '123456') { const li = document.createElement('li'); li.textContent = d; ul.append(li); }
map/append
const ul = document.createElement('ul'); const lis = Array.from('123456').map((d) => { const li = document.createElement('li'); li.textContent = d; return li; }); ul.append(...lis);
DocumentFragment
const ul = document.createElement('ul'); const fragment = new DocumentFragment(); for (const d of '123456') { const li = document.createElement('li'); li.textContent = d; fragment.append(li); } ul.append(fragment);