Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Chrome 96
Windows
Desktop
2 years ago
Test name Executions per second
Vanilla JS ID Selector 1222802.0 Ops/sec
Vanilla JS Class Selector 1098695.0 Ops/sec
Vanilla JS Query Selector All 629870.9 Ops/sec
Vanilla JS Query Selector 1125172.2 Ops/sec
Vanilla JS Data Hook 441754.3 Ops/sec
jQuery ID Selector 614642.3 Ops/sec
jQuery Class Selector 287968.2 Ops/sec
jQuery Data Hook Selector 192161.3 Ops/sec
HTML Preparation code:
Tests:
  • Vanilla JS ID Selector

  • Vanilla JS Class Selector

  • Vanilla JS Query Selector All

  • Vanilla JS Query Selector

  • Vanilla JS Data Hook

  • jQuery ID Selector

  • jQuery Class Selector

  • jQuery Data Hook Selector