Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
clientWidth vs offsetWidth vs window.getComputedStyle v2
(version: 0)
Comparing performance of:
clientWidth vs offsetwidth vs window.getComputedStyle
Created:
2 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div id="teste" style="width: 123px">teste</div>
Tests:
clientWidth
document.getElementById('teste').clientWidth;
offsetwidth
document.getElementById('teste').offsetwidth;
window.getComputedStyle
parseFloat(window.getComputedStyle(document.getElementById('teste')).width)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
clientWidth
offsetwidth
window.getComputedStyle
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0
Browser/OS:
Firefox 147 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
clientWidth
6360427.0 Ops/sec
offsetwidth
9635663.0 Ops/sec
window.getComputedStyle
1531731.2 Ops/sec
Related benchmarks:
clientHeight vs offsetHeight vs window.getComputedStyle
clientWidth vs offsetWidth vs window.getComputedStyle
clientWidth vs offsetWidth vs window.getComputedStyle vs getBoundingClientRect
clientWidth vs offsetWidth vs scrollWidth
Comments
Confirm delete:
Do you really want to delete benchmark?