Run details:
Mozilla/5.0 (Linux; Android 9; SM-G965F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36
Chrome Mobile 75
Android
Mobile
5 years ago
Test name Executions per second
getElementById() 1650420.6 Ops/sec
getElementsByClassName() 953179.6 Ops/sec
getElementsByTagName() 971365.9 Ops/sec
querySelector(#id) 903862.4 Ops/sec
querySelector(.id) 1129269.2 Ops/sec
querySelectorAll(#id) 474444.4 Ops/sec
querySelectorAll(.id) 588642.4 Ops/sec
jQuery(#id) 579976.7 Ops/sec
jQuery(.id) 309314.1 Ops/sec
jQuery(tag#id) 186349.2 Ops/sec
jQuery(tag.id) 189469.2 Ops/sec
jQuery + getElementById 707700.2 Ops/sec
jQuery + getElementsByClassName 229781.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


;