Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
Chrome 75
Linux
Desktop
5 years ago
Test name Executions per second
id - getElementById 3082223.5 Ops/sec
id - querySelector 1861489.6 Ops/sec
class - getElementsByClassName 2987928.0 Ops/sec
class - querySelectorAll 908795.7 Ops/sec
tag - getElementsByTagName 3045801.8 Ops/sec
tag - querySelectorAll 1011366.9 Ops/sec
HTML Preparation code:
Tests:
  • id - getElementById

  • id - querySelector

  • class - getElementsByClassName

  • class - querySelectorAll

  • tag - getElementsByTagName

  • tag - querySelectorAll


;