Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Windows
Desktop
one year ago
Test name Executions per second
getElementById 4497577.0 Ops/sec
getElementsByClassName 2458621.0 Ops/sec
getElementsByTagName 3448969.2 Ops/sec
querySelector (#id) 2197167.5 Ops/sec
querySelector (.id) 3156968.0 Ops/sec
querySelectorAll (#id) 1303684.5 Ops/sec
querySelectorAll (.id) 1723900.9 Ops/sec
Cash (#id) 1864847.5 Ops/sec
Cash (.id) 1389172.9 Ops/sec
Cash (tag#id) 885428.1 Ops/sec
Cash (tag.id) 1049909.6 Ops/sec
Cash + getElementById 1584057.4 Ops/sec
Cash + getElementsByClassName 1280998.4 Ops/sec
jQuery (#id) 1726463.5 Ops/sec
jQuery (.id) 912304.7 Ops/sec
jQuery (tag#id) 533453.2 Ops/sec
jQuery (tag.id) 617216.1 Ops/sec
jQuery + getElementById 1811869.2 Ops/sec
jQuery + getElementsByClassName 727197.5 Ops/sec
Umbrella(#id) 464359.9 Ops/sec
Umbrella(.id) 563696.4 Ops/sec
Umbrella(tag#id) 481680.0 Ops/sec
Umbrella(tag.id) 531958.6 Ops/sec
Umbrella + getElementById 1156742.0 Ops/sec
Umbrella + getElementsByClassName 395611.5 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


;