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() 1034775.6 Ops/sec
getElementsByClassName() 852824.2 Ops/sec
getElementsByTagName() 896148.6 Ops/sec
querySelector(#id) 477222.1 Ops/sec
querySelector(.id) 859230.1 Ops/sec
querySelectorAll(#id) 303685.8 Ops/sec
querySelectorAll(.id) 536897.0 Ops/sec
jQuery(#id) 306511.1 Ops/sec
jQuery(.id) 156665.3 Ops/sec
jQuery(tag#id) 96229.1 Ops/sec
jQuery(tag.id) 97759.5 Ops/sec
jQuery + getElementById 431318.6 Ops/sec
jQuery + getElementsByClassName 219003.0 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


;