offsetTop vs getBoundingClientRectFastest: getBoundingClientRect (1.6x faster)
904,074 ops/sec
563,082 ops/sec
Fastest: offsetTop (3.3x faster)
9,316,992 ops/sec
2,836,446 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| offsetTop | |
| getBoundingClientRect |
| Test name | Executions per second |
|---|---|
| ✓ getBoundingClientRect | 560,911 Ops/sec |
| offsetTop | 379,225 Ops/sec |