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
Jump 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:
9 months 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
Test name
Executions per second
lang
13580547.0 Ops/sec
getAttribute
14644111.0 Ops/sec
Related benchmarks:
getAttribute vs get property (.)
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?