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

Latest run results:
Run details: (Test run date: 11 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
getElementById 11050676.0 Ops/sec
jQuery (tag.id) 1585707.1 Ops/sec
jQuery (tag#id) 1411618.5 Ops/sec
jQuery (.id) 2631563.0 Ops/sec
jQuery (#id) 4627566.0 Ops/sec
Cash + getElementsByClassName 2929756.2 Ops/sec
Cash + getElementById 4495168.0 Ops/sec
Cash (tag.id) 2309697.5 Ops/sec
jQuery + getElementById 5006050.5 Ops/sec
Cash (tag#id) 1932334.5 Ops/sec
Cash (#id) 5040011.5 Ops/sec
querySelectorAll (.id) 3045331.2 Ops/sec
querySelectorAll (#id) 2679043.5 Ops/sec
querySelector (.id) 6098783.5 Ops/sec
querySelector (#id) 4262768.5 Ops/sec
getElementsByTagName 8326466.5 Ops/sec
getElementsByClassName 6958161.5 Ops/sec
Cash (.id) 3034542.2 Ops/sec
jQuery + getElementsByClassName 1746162.6 Ops/sec