Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 PaleMoon/28.12.0
Pale Moon (Firefox Variant) 28
Windows
Desktop
4 years ago
Test name Executions per second
getElementsById + getElementsByClassName 3658711.8 Ops/sec
querySelector + querySelector 2083007.1 Ops/sec
querySelector 2309904.8 Ops/sec
cache + getElementsByClassName 4617164.5 Ops/sec
cache + querySelector 3183228.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • getElementsById + getElementsByClassName

  • querySelector + querySelector

  • querySelector

  • cache + getElementsByClassName

  • cache + querySelector