Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0
Firefox 105
Ubuntu
Desktop
2 years ago
Test name Executions per second
Vanilla JS ID Selector 6321806.0 Ops/sec
Vanilla JS Class Selector 6092547.5 Ops/sec
Vanilla JS Data Hook 857645.0 Ops/sec
jQuery ID Selector 4019941.5 Ops/sec
jQuery Class Selector 1160969.8 Ops/sec
jQuery Data Hook Selector 525630.0 Ops/sec
HTML Preparation code:
Tests:
  • Vanilla JS ID Selector

  • Vanilla JS Class Selector

  • Vanilla JS Data Hook

  • jQuery ID Selector

  • jQuery Class Selector

  • jQuery Data Hook Selector