Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Firefox 132
Ubuntu
Desktop
25 days ago
Test name Executions per second
getElementById 5921505.0 Ops/sec
Umbrella(tag.id) 659797.1 Ops/sec
Umbrella(tag#id) 617042.3 Ops/sec
Umbrella(.id) 656626.9 Ops/sec
Umbrella(#id) 644504.4 Ops/sec
jQuery + getElementsByClassName 1286030.8 Ops/sec
jQuery + getElementById 4125965.8 Ops/sec
jQuery (tag.id) 962611.7 Ops/sec
jQuery (tag#id) 945863.2 Ops/sec
jQuery (.id) 1985559.5 Ops/sec
jQuery (#id) 7407952.5 Ops/sec
Umbrella + getElementById 1186384.8 Ops/sec
Cash + getElementsByClassName 2517597.5 Ops/sec
Cash (tag.id) 1293283.9 Ops/sec
Cash (tag#id) 1204281.9 Ops/sec
Cash (.id) 2809035.5 Ops/sec
Cash (#id) 7760837.0 Ops/sec
querySelectorAll (.id) 1545229.5 Ops/sec
querySelectorAll (#id) 1408590.6 Ops/sec
querySelector (.id) 3549211.2 Ops/sec
querySelector (#id) 3579967.0 Ops/sec
getElementsByTagName 4813066.5 Ops/sec
getElementsByClassName 3164335.8 Ops/sec
Cash + getElementById 3873927.0 Ops/sec
Umbrella + getElementsByClassName 939420.4 Ops/sec
HTML Preparation code:
Tests:
  • getElementById

  • Umbrella(tag.id)

  • Umbrella(tag#id)

  • Umbrella(.id)

  • Umbrella(#id)

  • jQuery + getElementsByClassName

  • jQuery + getElementById

  • jQuery (tag.id)

  • jQuery (tag#id)

  • jQuery (.id)

  • jQuery (#id)

  • Umbrella + getElementById

  • Cash + getElementsByClassName

  • Cash (tag.id)

  • Cash (tag#id)

  • Cash (.id)

  • Cash (#id)

  • querySelectorAll (.id)

  • querySelectorAll (#id)

  • querySelector (.id)

  • querySelector (#id)

  • getElementsByTagName

  • getElementsByClassName

  • Cash + getElementById

  • Umbrella + getElementsByClassName