Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
clientHeight vs offsetHeight vs window.getComputedStyle
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
offsetHeight
3.7M/s
clientHeight
3.3M/s
window.getComputedStyle
1.4M/s
Multiple: _style e clientHeight
889K/s
Multiple: Only _style
627K/s
View exact numbers
Test name
Executions per second
✓
offsetHeight
3,717,358 Ops/sec
clientHeight
3,254,357 Ops/sec
window.getComputedStyle
1,402,569 Ops/sec
Multiple: _style e clientHeight
888,765 Ops/sec
Multiple: Only _style
626,553 Ops/sec
HTML Preparation code:
<div id="teste">teste</div>
Script Preparation code:
var teste_n = '123px'; var _style = window.getComputedStyle(document.getElementById('teste'));
Tests:
clientHeight
document.getElementById('teste').clientHeight;
offsetHeight
document.getElementById('teste').offsetHeight;
window.getComputedStyle
parseFloat(_style['height'])
Multiple: Only _style
parseFloat(_style['margin-top']) parseFloat(_style['margin-bottom']) parseFloat(_style['height'])
Multiple: _style e clientHeight
parseFloat(_style['margin-top']) parseFloat(_style['margin-bottom']) document.getElementById('teste').clientHeight;