Run details:
Mozilla/5.0 (Linux; Android 10; M2007J20CG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36
Chrome Mobile 87
Android
Mobile
3 years ago
Test name Executions per second
getElementById 1917336.9 Ops/sec
jQuery (tag.id) 254192.8 Ops/sec
jQuery (tag#id) 243276.7 Ops/sec
jQuery (.id) 370727.2 Ops/sec
jQuery (#id) 530399.9 Ops/sec
Cash + getElementsByClassName 443499.4 Ops/sec
Cash + getElementById 771270.4 Ops/sec
Cash (tag.id) 370945.1 Ops/sec
jQuery + getElementById 802709.6 Ops/sec
Cash (tag#id) 359411.8 Ops/sec
Cash (#id) 605221.7 Ops/sec
querySelectorAll (.id) 684099.0 Ops/sec
querySelectorAll (#id) 568195.8 Ops/sec
querySelector (.id) 1080596.8 Ops/sec
querySelector (#id) 877084.4 Ops/sec
getElementsByTagName 1188836.5 Ops/sec
getElementsByClassName 1129544.4 Ops/sec
Cash (.id) 483519.6 Ops/sec
jQuery + getElementsByClassName 285566.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