Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0
Firefox 49
Windows
Other
8 years ago
Test name Executions per second
getElementById 8293076.0 Ops/sec
getElementsByClassName 3194828.8 Ops/sec
querySelector 4332244.0 Ops/sec
querySelectorAll 1153770.1 Ops/sec
jQuery 1792002.1 Ops/sec
jQuery + getElementById 2180089.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


;