Run details:
Mozilla/5.0 (Linux; U; Linux aarch64; en-US) AppleWebKit/602.1+ (KHTML, like Gecko) Espial/6.8.6 Version/4.0 Safari/602.1+
WebKit Nightly 602
Linux
Desktop
4 years ago
Test name Executions per second
getElementById() 1270307.8 Ops/sec
getElementsByClassName() 1055491.4 Ops/sec
getElementsByTagName() 912969.4 Ops/sec
querySelector(#id) 534790.2 Ops/sec
querySelector(.id) 1020285.7 Ops/sec
querySelectorAll(#id) 294230.1 Ops/sec
querySelectorAll(.id) 422916.5 Ops/sec
jQuery(#id) 313308.5 Ops/sec
jQuery(.id) 186520.9 Ops/sec
jQuery(tag#id) 113393.1 Ops/sec
jQuery(tag.id) 113584.2 Ops/sec
jQuery + getElementById 465886.6 Ops/sec
jQuery + getElementsByClassName 237036.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