Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
native fastest selector
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Browser:
Chrome 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
root.querySelectorAll "div"
6055.8 Ops/sec
root.querySelectorAll ".outer"
11729.9 Ops/sec
document.querySelectorAll "#root > .outer"
9195.6 Ops/sec
HTML Preparation code:
<div id="root"></div>
Script Preparation code:
let root = document.querySelector('#root'); for(let n=1; n<=1000; n++) root.insertAdjacentHTML("beforeend", '\n<div class="outer"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div class="inner">Test</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>');
Tests:
root.querySelectorAll "div"
let root = document.querySelector('#root'); root.querySelectorAll('div');
root.querySelectorAll ".outer"
let root = document.querySelector('#root'); root.querySelectorAll('.outer');
document.querySelectorAll "#root > .outer"
document.querySelectorAll('#root > .outer');