Run details:
Mozilla/5.0 (Android 10; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0
Firefox Mobile 68
Android
Mobile
4 years ago
Test name Executions per second
getElementById 1441897.8 Ops/sec
jQuery (tag.id) 197285.6 Ops/sec
jQuery (tag#id) 192734.6 Ops/sec
jQuery (.id) 391208.3 Ops/sec
jQuery (#id) 1171573.8 Ops/sec
Cash + getElementsByClassName 727382.6 Ops/sec
Cash + getElementById 799376.2 Ops/sec
Cash (tag.id) 451000.6 Ops/sec
jQuery + getElementById 912894.6 Ops/sec
Cash (tag#id) 409448.1 Ops/sec
Cash (#id) 1225423.8 Ops/sec
querySelectorAll (.id) 663059.5 Ops/sec
querySelectorAll (#id) 605073.3 Ops/sec
querySelector (.id) 1734201.8 Ops/sec
querySelector (#id) 1791467.1 Ops/sec
getElementsByTagName 1772801.2 Ops/sec
getElementsByClassName 1211602.2 Ops/sec
Cash (.id) 722675.8 Ops/sec
jQuery + getElementsByClassName 364681.4 Ops/sec
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