Run details:
Mozilla/5.0 (Linux; Android 10; LYA-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36
Chrome Mobile 87
Android
Mobile
3 years ago
Test name Executions per second
getElementById 1908939.5 Ops/sec
jQuery (tag.id) 276393.6 Ops/sec
jQuery (tag#id) 264663.1 Ops/sec
jQuery (.id) 410414.5 Ops/sec
jQuery (#id) 575932.8 Ops/sec
Cash + getElementsByClassName 484721.2 Ops/sec
Cash + getElementById 782995.6 Ops/sec
Cash (tag.id) 402311.4 Ops/sec
jQuery + getElementById 835519.4 Ops/sec
Cash (tag#id) 382419.3 Ops/sec
Cash (#id) 644082.4 Ops/sec
querySelectorAll (.id) 773239.4 Ops/sec
querySelectorAll (#id) 642648.0 Ops/sec
querySelector (.id) 1218568.8 Ops/sec
querySelector (#id) 944234.9 Ops/sec
getElementsByTagName 1329979.2 Ops/sec
getElementsByClassName 1091526.9 Ops/sec
Cash (.id) 536801.4 Ops/sec
jQuery + getElementsByClassName 304537.2 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


;