Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
insertAdjacentText vs new Text vs createTextNode vs textContent
(version: 1)
Comparing performance of:
insertAdjacentText vs new Text vs createTextNode vs textContent
Created:
3 months ago
by:
Guest
Jump to the latest result
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}'
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
insertAdjacentText
new Text
createTextNode
textContent
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Browser/OS:
Chrome 144 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
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
Related benchmarks:
textContent vs innerText
textContent vs insertAdjacentText 500x
insertAdjacentHTML VS append VS appendChild (createDocumentFragment) [div only]
innerText vs append v6
textContent vs append v10
textContent vs append v11
append vs appendChild v20
multiple vs divide
textContent vs innerHTML vs innerText vs
Comments
Confirm delete:
Do you really want to delete benchmark?