Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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; rv:146.0) Gecko/20100101 Firefox/146.0
Browser:
Firefox 146
Operating system:
Linux
Device Platform:
Desktop
Date tested:
9 months ago
Benchmark engine:
Benchmark.js
attributes property no action
5.7M/s
getAttributeNames method no action
4.8M/s
attributes property
3.5M/s
getAttributeNames method
3.3M/s
View exact numbers
Test name
Executions per second
✓
attributes property no action
5,682,687 Ops/sec
getAttributeNames method no action
4,764,723 Ops/sec
attributes property
3,466,156 Ops/sec
getAttributeNames method
3,273,733 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) { }