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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Browser:
Chrome 140
Operating system:
Windows
Device Platform:
Desktop
Date tested:
10 months ago
clientHeight
283K/s
offsetHeight
260K/s
window.getComputedStyle
137K/s
Multiple: _style e clientHeight
60K/s
Multiple: Only _style
49K/s
View exact numbers
Test name
Executions per second
✓
clientHeight
282,845 Ops/sec
offsetHeight
259,606 Ops/sec
window.getComputedStyle
136,940 Ops/sec
Multiple: _style e clientHeight
60,298 Ops/sec
Multiple: Only _style
49,251 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;