HTML Preparation code:
Tests:

Historical Performance Data aggregated from 123 community runs

Desktop Results:
Chrome 95 runs
getComputedStyle
405/s
getBoundingClientRect
216/s

Fastest: getComputedStyle (1.9x faster)

View exact numbers
  • getComputedStyle: 405 ops/sec
  • getBoundingClientRect: 216 ops/sec
Firefox 23 runs
getBoundingClientRect
413/s
getComputedStyle
261/s

Fastest: getBoundingClientRect (1.6x faster)

View exact numbers
  • getBoundingClientRect: 413 ops/sec
  • getComputedStyle: 261 ops/sec
Mobile Results:
Safari 5 runs
getComputedStyle
934/s
getBoundingClientRect
801/s

Fastest: getComputedStyle (1.2x faster)

View exact numbers
  • getComputedStyle: 934 ops/sec
  • getBoundingClientRect: 801 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
    getComputedStyle
    getBoundingClientRect

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Chrome 148 on Windows
View result in a separate tab
getComputedStyle
458/s
getBoundingClientRect
179/s
View exact numbers
Test name Executions per second
getComputedStyle 458 Ops/sec
getBoundingClientRect 179 Ops/sec