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; rv:141.0) Gecko/20100101 Firefox/141.0
Browser:
Firefox 141
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
appendChild
375K/s
map/append
322K/s
DocumentFragment
285K/s
append
207K/s
View exact numbers
Test name
Executions per second
✓
appendChild
374,824 Ops/sec
map/append
321,803 Ops/sec
DocumentFragment
284,859 Ops/sec
append
206,727 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);