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) 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:
9 months ago
Benchmark engine:
Benchmark.js
getAttributeNames method no action
8.1M/s
getAttributeNames method
4.4M/s
attributes property no action
1.4M/s
attributes property
1.2M/s
View exact numbers
Test name
Executions per second
✓
getAttributeNames method no action
8,083,761 Ops/sec
getAttributeNames method
4,405,297 Ops/sec
attributes property no action
1,440,394 Ops/sec
attributes property
1,163,231 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) { }