Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
JS: append vs appendChild - list of elements (1000 items)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0
Browser:
Firefox 120
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
append
5K/s
appendChild
3K/s
View exact numbers
Test name
Executions per second
✓
append
4,763 Ops/sec
appendChild
2,516 Ops/sec
HTML Preparation code:
<div id="container"></div>
Script Preparation code:
var container = document.getElementById("container"); var paragraph = document.createElement("p"); var num = 1000;
Tests:
append
const elArray = new Array(1000).fill(paragraph); container.append(...elArray);
appendChild
for(let i = 0; i < 1000; i++) { container.appendChild(paragraph); }