Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
insertAdjacentText vs new Text vs createTextNode vs textContent
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/144.0.0.0 Safari/537.36
Browser:
Chrome 144
Operating system:
Linux
Device Platform:
Desktop
Date tested:
3 months ago
Test name
Executions per second
insertAdjacentText
936.4 Ops/sec
new Text
825.1 Ops/sec
createTextNode
815.2 Ops/sec
textContent
855.3 Ops/sec
HTML Preparation code:
<style id="a"></style> <style id="b"></style> <style id="c"></style> <style id="d"></style>
Script Preparation code:
let a = document.getElementById('a') let b = document.getElementById('b') let c = document.getElementById('c') let d = document.getElementById('d')
Tests:
insertAdjacentText
a.insertAdjacentText('beforeend', 'p{color:red}')
new Text
b.appendChild(new Text('p{color:red}'))
createTextNode
c.appendChild(document.createTextNode('p{color:red}'))
textContent
d.textContent += 'p{color:red}'