Run details:
Mozilla/5.0 (Linux; Android 9; BKL-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36
Chrome Mobile 96
Android
Mobile
2 years ago
Test name Executions per second
getElementById 834453.5 Ops/sec
jQuery (tag.id) 157276.9 Ops/sec
jQuery (tag#id) 146982.2 Ops/sec
jQuery (.id) 225294.3 Ops/sec
jQuery (#id) 379899.2 Ops/sec
Cash + getElementsByClassName 330489.0 Ops/sec
Cash + getElementById 475023.6 Ops/sec
Cash (tag.id) 281728.0 Ops/sec
jQuery + getElementById 557352.1 Ops/sec
Cash (tag#id) 218416.8 Ops/sec
Cash (#id) 446601.6 Ops/sec
querySelectorAll (.id) 494756.1 Ops/sec
querySelectorAll (#id) 400396.2 Ops/sec
querySelector (.id) 817522.7 Ops/sec
querySelector (#id) 677541.8 Ops/sec
getElementsByTagName 877620.7 Ops/sec
getElementsByClassName 620094.2 Ops/sec
Cash (.id) 326571.4 Ops/sec
jQuery + getElementsByClassName 188696.7 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