Run details:
Mozilla/5.0 (Linux; Android 10; MI 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.60 Mobile Safari/537.36
Chrome Mobile 83
Android
Mobile
4 years ago
Test name Executions per second
getElementById 1974065.1 Ops/sec
jQuery (tag.id) 247767.5 Ops/sec
jQuery (tag#id) 259653.8 Ops/sec
jQuery (.id) 244777.6 Ops/sec
jQuery (#id) 609652.0 Ops/sec
Cash + getElementsByClassName 538145.5 Ops/sec
Cash + getElementById 831224.6 Ops/sec
Cash (tag.id) 430760.0 Ops/sec
jQuery + getElementById 902445.8 Ops/sec
Cash (tag#id) 397207.1 Ops/sec
Cash (#id) 706084.0 Ops/sec
querySelectorAll (.id) 609170.5 Ops/sec
querySelectorAll (#id) 570820.4 Ops/sec
querySelector (.id) 1371238.5 Ops/sec
querySelector (#id) 1157273.6 Ops/sec
getElementsByTagName 1515089.2 Ops/sec
getElementsByClassName 1239826.5 Ops/sec
Cash (.id) 493366.6 Ops/sec
jQuery + getElementsByClassName 311049.8 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


;