Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
Firefox 66
Windows
Desktop
5 years ago
Test name Executions per second
impicit elementId 22301.4 Ops/sec
explicit getElementById 28488.1 Ops/sec
id function 23198.5 Ops/sec
id var function 24085.6 Ops/sec
id var arrow function 25727.0 Ops/sec
element var 32417.2 Ops/sec
var element in block scope 30909.1 Ops/sec
let element in block scope 29645.1 Ops/sec
const element in block scope 32166.2 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