Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
get all element's attributes
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/143.0.0.0 Safari/537.36
Browser:
Chrome 143
Operating system:
Linux
Device Platform:
Desktop
Date tested:
4 months ago
Test name
Executions per second
getAttributeNames method
4405297.0 Ops/sec
attributes property
1163230.6 Ops/sec
getAttributeNames method no action
8083761.0 Ops/sec
attributes property no action
1440394.1 Ops/sec
HTML Preparation code:
<a id="id" class="button" href="/"></a>
Script Preparation code:
var el = document.getElementById('id')
Tests:
getAttributeNames method
for (var name of el.getAttributeNames()) { name + ':' + el.getAttribute(name) }
attributes property
for(var attr of el.attributes) { attr.name + ':' + attr.value }
getAttributeNames method no action
for (var name of el.getAttributeNames()) { }
attributes property no action
for(var attr of el.attributes) { }