clientHeight vs offsetHeight vs getBoundingClientRectFastest: clientHeight (1.5x faster)
1,536,248 ops/sec
1,388,297 ops/sec
1,035,856 ops/sec
Fastest: clientHeight (2.0x faster)
4,658,453 ops/sec
4,249,774 ops/sec
2,323,792 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| clientHeight | |
| offsetHeight | |
| getBoundingClientRect |
| Test name | Executions per second |
|---|---|
| ✓ offsetHeight | 1,314,819 Ops/sec |
| clientHeight | 1,240,956 Ops/sec |
| getBoundingClientRect | 927,118 Ops/sec |