Run details:
Mozilla/5.0 (Linux; Android 10; SAMSUNG SM-G965F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/13.2 Chrome/83.0.4103.106 Mobile Safari/537.36
Chrome Mobile 83
Android
Mobile
3 years ago
Test name Executions per second
getElementById 1157531.0 Ops/sec
querySelector 725910.8 Ops/sec
getElementsByClassName 750478.1 Ops/sec
querySelectorAll 406917.8 Ops/sec
querySelector class 930421.6 Ops/sec
HTML Preparation code:
Tests:
  • getElementById

  • querySelector

  • getElementsByClassName

  • querySelectorAll

  • querySelector class