Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
offsetHeight vs getClientBoundingRect().height
(version: 1)
Comparing performance of:
offsetHeight vs getBoundingCientRect
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div id="el"> <h2>Lorem ipsum dolor sit amet</h2> </div>
Script Preparation code:
var el = document.getElementById("el");
Tests:
offsetHeight
const height = el.offsetHeight; const perim = height * 2;
getBoundingCientRect
const rect = el.getBoundingClientRect(); const height = rect.height; const perim = height * 2;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
offsetHeight
getBoundingCientRect
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser/OS:
Chrome 136 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
offsetHeight
2115258.5 Ops/sec
getBoundingCientRect
1222938.4 Ops/sec
Related benchmarks:
clientWidth / clientHeight vs. getBoundingClientRect()
Dom element measure #1
clientWidth / clientHeight vs. getBoundingClientRect()awe
clientHeight vs offsetHeight vs getBoundingClientRect
offsetWidth / offsetHeight vs. getBoundingClientRect()
getBoundingClientRect vs offset
clientHeight vs offsetHeight vs getBoundingClientRect height only
clientWidth / clientHeight vs. getBoundingClientRect() vs. getComputedStyle
offsetWidth / offsetHeight vs. getBoundingClientRect() vs. clientWidth / clientHeight
Comments
Confirm delete:
Do you really want to delete benchmark?