Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Chrome 103
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Vanilla JS ID Selector 7528624.0 Ops/sec
Vanilla JS Class Selector 7218534.5 Ops/sec
Vanilla JS Query Selector All 3293531.2 Ops/sec
Vanilla JS Query Selector 6276513.5 Ops/sec
Vanilla JS Data Hook 2549849.0 Ops/sec
jQuery ID Selector 4412877.0 Ops/sec
jQuery Class Selector 2054835.4 Ops/sec
jQuery Data Hook Selector 1227681.5 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