Run details:
Mozilla/5.0 (Linux; U; Linux x86_64; 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() 4393312.0 Ops/sec
getElementsByClassName() 3534568.2 Ops/sec
getElementsByTagName() 3796336.0 Ops/sec
querySelector(#id) 1525850.4 Ops/sec
querySelector(.id) 3521444.0 Ops/sec
querySelectorAll(#id) 828790.9 Ops/sec
querySelectorAll(.id) 1349647.2 Ops/sec
jQuery(#id) 1462937.5 Ops/sec
jQuery(.id) 420296.5 Ops/sec
jQuery(tag#id) 244109.3 Ops/sec
jQuery(tag.id) 247293.1 Ops/sec
jQuery + getElementById 1795328.6 Ops/sec
jQuery + getElementsByClassName 515315.4 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


;