Run details:
Mozilla/5.0 (Linux; Android 13; SM-F721B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36
Chrome Mobile 111
Android
Mobile
one year ago
Test name Executions per second
getElementById 2566648.0 Ops/sec
jQuery (tag.id) 419644.6 Ops/sec
jQuery (tag#id) 383933.2 Ops/sec
jQuery (.id) 566904.0 Ops/sec
jQuery (#id) 859598.2 Ops/sec
Cash + getElementsByClassName 642421.9 Ops/sec
Cash + getElementById 924573.3 Ops/sec
Cash (tag.id) 583854.4 Ops/sec
jQuery + getElementById 957516.6 Ops/sec
Cash (tag#id) 474104.5 Ops/sec
Cash (#id) 930262.1 Ops/sec
querySelectorAll (.id) 931237.3 Ops/sec
querySelectorAll (#id) 709861.4 Ops/sec
querySelector (.id) 1692378.5 Ops/sec
querySelector (#id) 1354076.0 Ops/sec
getElementsByTagName 2101561.2 Ops/sec
getElementsByClassName 1644547.1 Ops/sec
Cash (.id) 752530.2 Ops/sec
jQuery + getElementsByClassName 444831.3 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