Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Chrome 110
Windows
Desktop
one year ago
Test name Executions per second
getElementById 4851725.0 Ops/sec
getElementsByClassName 2799231.5 Ops/sec
getElementsByTagName 3810906.8 Ops/sec
querySelector (#id) 2373734.2 Ops/sec
querySelector (.id) 3450629.5 Ops/sec
querySelectorAll (#id) 1341698.2 Ops/sec
querySelectorAll (.id) 1851431.4 Ops/sec
Cash (#id) 2042260.9 Ops/sec
Cash (.id) 1510190.8 Ops/sec
Cash (tag#id) 931227.1 Ops/sec
Cash (tag.id) 1106233.6 Ops/sec
Cash + getElementById 1801361.2 Ops/sec
Cash + getElementsByClassName 1382831.2 Ops/sec
jQuery (#id) 1842974.8 Ops/sec
jQuery (.id) 1080651.2 Ops/sec
jQuery (tag#id) 609768.8 Ops/sec
jQuery (tag.id) 701089.8 Ops/sec
jQuery + getElementById 1862473.6 Ops/sec
jQuery + getElementsByClassName 765867.7 Ops/sec
Umbrella(#id) 507789.9 Ops/sec
Umbrella(.id) 602162.4 Ops/sec
Umbrella(tag#id) 512120.7 Ops/sec
Umbrella(tag.id) 561020.1 Ops/sec
Umbrella + getElementById 1229320.8 Ops/sec
Umbrella + getElementsByClassName 673674.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


;