Run details:
Mozilla/5.0 (Linux; Android 9; TA-1012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.112 Mobile Safari/537.36
Chrome Mobile 74
Android
Mobile
5 years ago
Test name Executions per second
impicit elementId 6635.7 Ops/sec
explicit getElementById 7293.1 Ops/sec
id function 7071.1 Ops/sec
id var function 6987.2 Ops/sec
id var arrow function 7177.8 Ops/sec
element var 7616.3 Ops/sec
var element in block scope 7730.0 Ops/sec
let element in block scope 7685.0 Ops/sec
const element in block scope 7560.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • impicit elementId

  • explicit getElementById

  • id function

  • id var function

  • id var arrow function

  • element var

  • var element in block scope

  • let element in block scope

  • const element in block scope