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: 12 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Chrome 89 on Windows
View result in a separate tab
Test name Executions per second
getElementById 1883084.0 Ops/sec
jQuery (tag.id) 203594.6 Ops/sec
jQuery (tag#id) 197280.7 Ops/sec
jQuery (.id) 306257.8 Ops/sec
jQuery (#id) 808180.9 Ops/sec
Cash + getElementsByClassName 353030.1 Ops/sec
Cash + getElementById 652925.9 Ops/sec
Cash (tag.id) 320830.4 Ops/sec
jQuery + getElementById 720162.5 Ops/sec
Cash (tag#id) 274292.8 Ops/sec
Cash (#id) 1010818.0 Ops/sec
querySelectorAll (.id) 792254.6 Ops/sec
querySelectorAll (#id) 603914.3 Ops/sec
querySelector (.id) 1407289.0 Ops/sec
querySelector (#id) 1043500.0 Ops/sec
getElementsByTagName 1487543.0 Ops/sec
getElementsByClassName 918579.3 Ops/sec
Cash (.id) 416754.8 Ops/sec
jQuery + getElementsByClassName 234002.6 Ops/sec