Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15
Safari 15
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Vanilla JS ID Selector 9488711.0 Ops/sec
Vanilla JS Class Selector 8881403.0 Ops/sec
Vanilla JS Query Selector All 4532871.5 Ops/sec
Vanilla JS Query Selector 7081519.0 Ops/sec
Vanilla JS Data Hook 3565451.8 Ops/sec
jQuery ID Selector 5281759.5 Ops/sec
jQuery Class Selector 2566495.5 Ops/sec
jQuery Data Hook Selector 1824052.4 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