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() 1013453.8 Ops/sec
getElementsByClassName() 772297.9 Ops/sec
getElementsByTagName() 831933.0 Ops/sec
querySelector(#id) 482718.2 Ops/sec
querySelector(.id) 846114.0 Ops/sec
querySelectorAll(#id) 305580.7 Ops/sec
querySelectorAll(.id) 501767.9 Ops/sec
jQuery(#id) 327186.5 Ops/sec
jQuery(.id) 152302.1 Ops/sec
jQuery(tag#id) 104038.6 Ops/sec
jQuery(tag.id) 105553.2 Ops/sec
jQuery + getElementById 453988.5 Ops/sec
jQuery + getElementsByClassName 231347.5 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