Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 Edg/81.0.416.77
Chrome 81
Windows
Desktop
4 years ago
Test name Executions per second
getElementById 5181087.5 Ops/sec
getElementsByTagName 1758215.6 Ops/sec
querySelector 2558203.2 Ops/sec
getElementsByClassName 2239951.8 Ops/sec
getElementsByName 2542983.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • getElementById

  • getElementsByTagName

  • querySelector

  • getElementsByClassName

  • getElementsByName