HTML Preparation code:
Tests:
  • getElementById

  • getElementsByClassName

  • getElementsByTagName

  • querySelector (#id)

  • querySelector (.id)

  • querySelectorAll (#id)

  • querySelectorAll (.id)

  • Cash (#id)

  • Cash (.id)

  • Cash (tag#id)

  • Cash (tag.id)

  • Cash + getElementById

  • Cash + getElementsByClassName

  • jQuery (#id)

  • jQuery (.id)

  • jQuery (tag#id)

  • jQuery (tag.id)

  • jQuery + getElementById

  • jQuery + getElementsByClassName

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    getElementById
    getElementsByClassName
    getElementsByTagName
    querySelector (#id)
    querySelector (.id)
    querySelectorAll (#id)
    querySelectorAll (.id)
    Cash (#id)
    Cash (.id)
    Cash (tag#id)
    Cash (tag.id)
    Cash + getElementById
    Cash + getElementsByClassName
    jQuery (#id)
    jQuery (.id)
    jQuery (tag#id)
    jQuery (tag.id)
    jQuery + getElementById
    jQuery + getElementsByClassName

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: 7 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 Edg/91.0.864.37
Chrome 91 on Windows
View result in a separate tab
Test name Executions per second
getElementById 3312481.0 Ops/sec
jQuery (tag.id) 158099.6 Ops/sec
jQuery (tag#id) 171633.8 Ops/sec
jQuery (.id) 238235.0 Ops/sec
jQuery (#id) 1062235.0 Ops/sec
Cash + getElementsByClassName 1059542.0 Ops/sec
Cash + getElementById 1279994.0 Ops/sec
Cash (tag.id) 772122.8 Ops/sec
jQuery + getElementById 637030.6 Ops/sec
Cash (tag#id) 669277.3 Ops/sec
Cash (#id) 1968649.0 Ops/sec
querySelectorAll (.id) 1686343.0 Ops/sec
querySelectorAll (#id) 1167719.0 Ops/sec
querySelector (.id) 3458488.0 Ops/sec
querySelector (#id) 2035499.0 Ops/sec
getElementsByTagName 2715259.0 Ops/sec
getElementsByClassName 2247865.0 Ops/sec
Cash (.id) 935604.3 Ops/sec
jQuery + getElementsByClassName 274321.4 Ops/sec