clientHeight vs offsetHeight vs getBoundingClientRectFastest: clientHeight (1.5x faster)
1,613,625 ops/sec
1,477,156 ops/sec
1,046,514 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 | 2,173,186 Ops/sec |
| clientHeight | 2,064,803 Ops/sec |
| getBoundingClientRect | 1,508,805 Ops/sec |