Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
id vs attribute
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:150.0) Gecko/20100101 Firefox/150.0
Browser:
Firefox 150
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
5 months ago
Benchmark engine:
Benchmark.js
id selector
3.3M/s
attribute selector
2.8M/s
beginning with attribute selector
2.6M/s
View exact numbers
Test name
Executions per second
✓
id selector
3,313,027 Ops/sec
attribute selector
2,769,202 Ops/sec
beginning with attribute selector
2,605,607 Ops/sec
HTML Preparation code:
<div id="variableContainerSso"></div>
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
beginning with attribute selector
document.querySelector("div[id^='variableContainerSso']")
attribute selector
document.querySelector("div[id='variableContainerSso']")
id selector
document.querySelector("#variableContainerSso")