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 9322614.0 Ops/sec
getElementsByClassName 3466989.0 Ops/sec
querySelector 4964249.0 Ops/sec
querySelectorAll 1299822.0 Ops/sec
jQuery 3213696.0 Ops/sec
jQuery + getElementById 5350325.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


;