getComputedStyle vs getBoundingClientRect vs clientheightFastest: getComputedStyle (2.1x faster)
789 ops/sec
567 ops/sec
380 ops/sec
Fastest: clientheight (2.9x faster)
1,233 ops/sec
652 ops/sec
425 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| getComputedStyle | |
| getBoundingClientRect | |
| clientheight |
| Test name | Executions per second |
|---|---|
| ✓ getComputedStyle | 468 Ops/sec |
| clientheight | 309 Ops/sec |
| getBoundingClientRect | 207 Ops/sec |