Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Linux
Desktop
one year ago
Test name Executions per second
getElementById 4881847.5 Ops/sec
getElementsByClassName 3217128.8 Ops/sec
getElementsByTagName 3707519.2 Ops/sec
querySelector (#id) 2210109.0 Ops/sec
querySelector (.id) 3615973.2 Ops/sec
querySelectorAll (#id) 1281168.4 Ops/sec
querySelectorAll (.id) 1813206.1 Ops/sec
Cash (#id) 1994651.6 Ops/sec
Cash (.id) 1454077.5 Ops/sec
Cash (tag#id) 891103.1 Ops/sec
Cash (tag.id) 1007108.7 Ops/sec
Cash + getElementById 1781113.9 Ops/sec
Cash + getElementsByClassName 1442425.5 Ops/sec
jQuery (#id) 1799376.4 Ops/sec
jQuery (.id) 985682.2 Ops/sec
jQuery (tag#id) 559641.8 Ops/sec
jQuery (tag.id) 638208.7 Ops/sec
jQuery + getElementById 1790113.2 Ops/sec
jQuery + getElementsByClassName 802778.9 Ops/sec
Umbrella(#id) 471808.2 Ops/sec
Umbrella(.id) 520650.2 Ops/sec
Umbrella(tag#id) 476042.4 Ops/sec
Umbrella(tag.id) 467797.9 Ops/sec
Umbrella + getElementById 1099308.2 Ops/sec
Umbrella + getElementsByClassName 621509.2 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