offsetWidth vs getBoundingClientRect1

Comparing performance of: offsetwidth vs getBoundingClientRect
2 months ago
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Test name Executions per second
offsetWidth 1453534.2 Ops/sec
getBoundingClientRect 958369.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • offsetWidth

  • getBoundingClientRect

Open this result on MeasureThat.net