Run details:
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36
Chrome 90
Windows 7
Desktop
3 years ago
Test name Executions per second
querySelector 2363347.0 Ops/sec
querySelectorAll 1190466.9 Ops/sec
getElementsByClassName 3374788.8 Ops/sec
querySelector (ID) 1844453.0 Ops/sec
getElementsByID 3588550.8 Ops/sec
HTML Preparation code:
Tests:
  • querySelector

  • querySelectorAll

  • getElementsByClassName

  • querySelector (ID)

  • getElementsByID


;