Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
insertAdjacentHTML vs append cloneNode
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Browser:
Chrome 120
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
append cloneNode
3/s
insertAdjacentHTML
1/s
View exact numbers
Test name
Executions per second
✓
append cloneNode
3 Ops/sec
insertAdjacentHTML
1 Ops/sec
HTML Preparation code:
<form id='test'></form>
Tests:
append cloneNode
const htmlStrg = `<fieldset class='grid-container'><div class='cell'><input type='date' name='date' class='input input-date'></div></fieldset>` const parsedHTML = new DOMParser().parseFromString(htmlStrg, 'text/html').body.firstChild const form = document.getElementById('test') for (let i = 0; i < 200; i++) { form.appendChild(parsedHTML.cloneNode(true)) }
insertAdjacentHTML
const htmlStrg = `<fieldset class='grid-container'><div class='cell'><input type='date' name='date' class='input input-date'></div></fieldset>` const form = document.getElementById('test') for (let i = 0; i < 200; i++) { form.insertAdjacentHTML('beforeend', htmlStrg) }