Run details:
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36
Chrome 80
Windows 8.1
Desktop
4 years ago
Test name Executions per second
getElementById 1627922.1 Ops/sec
getElementsByTagName 612800.6 Ops/sec
querySelector 686352.6 Ops/sec
getElementsByClassName 669146.9 Ops/sec
getElementsByName 806052.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • getElementById

  • getElementsByTagName

  • querySelector

  • getElementsByClassName

  • getElementsByName