HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 16 community runs

Desktop Results:
Chrome 10 runs
getBoundingClientRect
904K/s
offsetTop
563K/s

Fastest: getBoundingClientRect (1.6x faster)

View exact numbers
  • getBoundingClientRect: 904,074 ops/sec
  • offsetTop: 563,082 ops/sec
Firefox 6 runs
offsetTop
9.3M/s
getBoundingClientRect
2.8M/s

Fastest: offsetTop (3.3x faster)

View exact numbers
  • offsetTop: 9,316,992 ops/sec
  • getBoundingClientRect: 2,836,446 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    offsetTop
    getBoundingClientRect

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Chrome 148 on Linux
View result in a separate tab
getBoundingClientRect
561K/s
offsetTop
379K/s
View exact numbers
Test name Executions per second
getBoundingClientRect 560,911 Ops/sec
offsetTop 379,225 Ops/sec