Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Chrome 132
Windows
Desktop
3 months ago
Test name Executions per second
querySelector 7442707.0 Ops/sec
querySelectorAll 2241628.8 Ops/sec
getElementsByClassName 15445512.0 Ops/sec
querySelector (ID) 3133493.8 Ops/sec
getElementsByID 12854548.0 Ops/sec
HTML Preparation code:
Tests:
  • querySelector

  • querySelectorAll

  • getElementsByClassName

  • querySelector (ID)

  • getElementsByID