Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Firefox 64
Windows
Desktop
5 years ago
Test name Executions per second
impicit elementId 22057.1 Ops/sec
explicit getElementById 28220.6 Ops/sec
id function 23467.1 Ops/sec
id var function 26266.5 Ops/sec
id var arrow function 25319.1 Ops/sec
element var 31930.6 Ops/sec
var element in block scope 31310.7 Ops/sec
let element in block scope 31984.3 Ops/sec
const element in block scope 31892.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