Run details:
Mozilla/5.0 (Linux; Android 9; ONEPLUS A3000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36
Chrome Mobile 87
Android
Mobile
4 years ago
Test name Executions per second
getElementById 1156972.5 Ops/sec
jQuery (tag.id) 76735.5 Ops/sec
jQuery (tag#id) 70745.9 Ops/sec
jQuery (.id) 109822.7 Ops/sec
jQuery (#id) 166317.1 Ops/sec
Cash + getElementsByClassName 199950.3 Ops/sec
Cash + getElementById 308443.1 Ops/sec
Cash (tag.id) 135983.7 Ops/sec
jQuery + getElementById 324410.0 Ops/sec
Cash (tag#id) 121324.0 Ops/sec
Cash (#id) 198019.5 Ops/sec
querySelectorAll (.id) 309449.4 Ops/sec
querySelectorAll (#id) 179858.2 Ops/sec
querySelector (.id) 787042.4 Ops/sec
querySelector (#id) 604543.9 Ops/sec
getElementsByTagName 842665.1 Ops/sec
getElementsByClassName 493337.8 Ops/sec
Cash (.id) 168384.1 Ops/sec
jQuery + getElementsByClassName 99243.3 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