Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Declarative shadow dom
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0
Browser:
Firefox 112
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
DOMParser code
9151.8 Ops/sec
AttachShadow
169468.3 Ops/sec
HTML Preparation code:
<div id="container"></div>
Tests:
DOMParser code
const prerendered = ` <div> <template shadowroot="open"> <p> Dynamically loaded shadow dom </p> <p> Dynamically loaded shadow dom </p> </template> </div> `; const elem = new DOMParser().parseFromString(prerendered, 'text/html', { includeShadowRoots: true}); document.getElementById('container').appendChild(...elem.body.children)
AttachShadow
const container = document.getElementById('container'); const elem = document.createElement('div'); const shadow = elem.attachShadow({mode: 'open'}); shadow.textContent = ` <p> Dynamically loaded shadow dom </p> <p> Dynamically loaded shadow dom </p> `; container.appendChild(elem);