Run details:
Mozilla/5.0 (Linux; Android 9; ZB602KL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36
Chrome Mobile 81
Android
Mobile
4 years ago
Test name Executions per second
getElementById 1111115.6 Ops/sec
jQuery (tag.id) 155339.4 Ops/sec
jQuery (tag#id) 140957.2 Ops/sec
jQuery (.id) 239151.1 Ops/sec
jQuery (#id) 331231.7 Ops/sec
Cash + getElementsByClassName 278000.8 Ops/sec
Cash + getElementById 401173.3 Ops/sec
Cash (tag.id) 231373.9 Ops/sec
jQuery + getElementById 468069.2 Ops/sec
Cash (tag#id) 220502.9 Ops/sec
Cash (#id) 345923.1 Ops/sec
querySelectorAll (.id) 379550.9 Ops/sec
querySelectorAll (#id) 319917.2 Ops/sec
querySelector (.id) 766673.4 Ops/sec
querySelector (#id) 578585.7 Ops/sec
getElementsByTagName 840246.6 Ops/sec
getElementsByClassName 682782.4 Ops/sec
Cash (.id) 302069.2 Ops/sec
jQuery + getElementsByClassName 178637.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


;