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; rv:130.0) Gecko/20100101 Firefox/130.0
Browser:
Firefox 130
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
clientHeight
7.1M/s
offsetHeight
6.3M/s
window.getComputedStyle
6.3M/s
Multiple: _style e clientHeight
2.5M/s
Multiple: Only _style
2.4M/s
View exact numbers
Test name
Executions per second
✓
clientHeight
7,065,394 Ops/sec
offsetHeight
6,314,260 Ops/sec
window.getComputedStyle
6,251,313 Ops/sec
Multiple: _style e clientHeight
2,497,633 Ops/sec
Multiple: Only _style
2,433,755 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;