Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Property vs getAttribute
(version: 1)
Comparing performance of:
lang vs getAttribute
Created:
one year ago
by:
Guest
Go to the latest result
HTML Preparation code:
<html lang="en"> <head></head> <body></body> </html>
Tests:
lang
const lang = document.documentElement.lang;
getAttribute
const lang = document.documentElement.getAttribute('lang');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
lang
getAttribute
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0
Browser/OS:
Firefox 141 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
getAttribute
14.6M/s
lang
13.6M/s
View exact numbers
Test name
Executions per second
✓
getAttribute
14,644,111 Ops/sec
lang
13,580,547 Ops/sec
Related benchmarks
using getAttribute vs innerHtml
js - title vs setAttribute
js - title vs setAttribute /2
js - title vs getAttribute
js - title vs getAttribute /2
js - title vs getAttribute vs hasAttribute
js - title vs getAttribute vs hasAttribute /well
js - title vs getAttribute vs hasAttribute /well2
Comments
Confirm delete:
Do you really want to delete benchmark?