Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 OPR/73.0.3856.344
Opera 73
Windows 7
Desktop
3 years ago
Test name Executions per second
getElementById 2131021.0 Ops/sec
getElementsByTagName 843435.3 Ops/sec
querySelector 1479679.0 Ops/sec
getElementsByClassName 1139067.2 Ops/sec
getElementsByName 1352607.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • getElementById

  • getElementsByTagName

  • querySelector

  • getElementsByClassName

  • getElementsByName