Tests:
-
offsetWidth / offsetHeight (destructured and renamed)
-
offsetWidth / offsetHeight (destructured)
-
offsetWidth / offsetHeight (simple property access)
-
getBoundingClientRect() (destructured)
-
getBoundingClientRect() (simple property access)
-
clientWidth / clientHeight (destructured)
-
clientWidth / clientHeight (simple property access)
Rendered benchmark preparation results:
Latest run results:
Run details: (Test run date:
one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Chrome 137 on Mac OS X 10.15.7
View result in a separate tab
getBoundingClientRect() (simple property access)
2.9M/s
getBoundingClientRect() (destructured)
2.6M/s
clientWidth / clientHeight (destructured)
2.5M/s
clientWidth / clientHeight (simple property access)
2.5M/s
offsetWidth / offsetHeight (simple property access)
2.3M/s
offsetWidth / offsetHeight (destructured)
2.1M/s
offsetWidth / offsetHeight (destructured and renamed)
1.9M/s
View exact numbers
| Test name |
Executions per second |
|
✓
getBoundingClientRect() (simple property access)
|
2,854,651 Ops/sec |
|
getBoundingClientRect() (destructured)
|
2,552,615 Ops/sec |
|
clientWidth / clientHeight (destructured)
|
2,471,218 Ops/sec |
|
clientWidth / clientHeight (simple property access)
|
2,470,721 Ops/sec |
|
offsetWidth / offsetHeight (simple property access)
|
2,253,865 Ops/sec |
|
offsetWidth / offsetHeight (destructured)
|
2,147,354 Ops/sec |
|
offsetWidth / offsetHeight (destructured and renamed)
|
1,943,031 Ops/sec |
Do you really want to delete benchmark?