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() 1065121.9 Ops/sec
getElementsByClassName() 786463.5 Ops/sec
getElementsByTagName() 843856.7 Ops/sec
querySelector(#id) 472021.8 Ops/sec
querySelector(.id) 818479.4 Ops/sec
querySelectorAll(#id) 300740.6 Ops/sec
querySelectorAll(.id) 468843.5 Ops/sec
jQuery(#id) 320564.5 Ops/sec
jQuery(.id) 150413.0 Ops/sec
jQuery(tag#id) 95876.6 Ops/sec
jQuery(tag.id) 96771.3 Ops/sec
jQuery + getElementById 455118.0 Ops/sec
jQuery + getElementsByClassName 209447.6 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


;