scrollHeight vs getBoundingClientRect().heightFastest: scrollHeight (1.3x faster)
1,659,170 ops/sec
1,266,236 ops/sec
Fastest: scrollHeight (2.7x faster)
10,864,296 ops/sec
4,054,074 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| scrollHeight | |
| getBoundingClientRect().height |
| Test name | Executions per second |
|---|---|
| ✓ scrollHeight | 6,592,304 Ops/sec |
| getBoundingClientRect().height | 3,575,261 Ops/sec |