getComputedStyle vs getBoundingClientRectFastest: getComputedStyle (1.9x faster)
405 ops/sec
216 ops/sec
Fastest: getBoundingClientRect (1.6x faster)
413 ops/sec
261 ops/sec
Fastest: getComputedStyle (1.2x faster)
934 ops/sec
801 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 |
| Test name | Executions per second |
|---|---|
| ✓ getComputedStyle | 458 Ops/sec |
| getBoundingClientRect | 179 Ops/sec |