Run details:
Mozilla/5.0 (Linux; Android 10; ONEPLUS A5000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Mobile Safari/537.36
Chrome Mobile 84
Android
Mobile
4 years ago
Test name Executions per second
getElementsById + getElementsByClassName 1136900.8 Ops/sec
querySelector + querySelector 646935.6 Ops/sec
querySelector 710956.8 Ops/sec
cache + getElementsByClassName 1308206.0 Ops/sec
cache + querySelector 966942.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • getElementsById + getElementsByClassName

  • querySelector + querySelector

  • querySelector

  • cache + getElementsByClassName

  • cache + querySelector


;