HTML Preparation code:
Tests:

Historical Performance Data aggregated from 16 community runs

Desktop Results:
Chrome 11 runs
getBoundingClientRect
1.1M/s
window.getComputedStyle + new WebKitCSSMatrix
577K/s

Fastest: getBoundingClientRect (1.9x faster)

View exact numbers
  • getBoundingClientRect : 1,092,122 ops/sec
  • window.getComputedStyle + new WebKitCSSMatrix: 577,204 ops/sec
Firefox 5 runs
getBoundingClientRect
1.7M/s
window.getComputedStyle + new WebKitCSSMatrix
572K/s

Fastest: getBoundingClientRect (3.0x faster)

View exact numbers
  • getBoundingClientRect : 1,732,822 ops/sec
  • window.getComputedStyle + new WebKitCSSMatrix: 572,462 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
    getBoundingClientRect
    window.getComputedStyle + new WebKitCSSMatrix

    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; rv:151.0) Gecko/20100101 Firefox/151.0
Firefox 151 on Windows
View result in a separate tab
getBoundingClientRect
1.7M/s
window.getComputedStyle + new WebKitCSSMatrix
572K/s
View exact numbers
Test name Executions per second
getBoundingClientRect 1,732,822 Ops/sec
window.getComputedStyle + new WebKitCSSMatrix 572,462 Ops/sec