Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0
Firefox 99
Ubuntu
Desktop
2 years ago
Test name Executions per second
Pure JS ID Selector 54472.6 Ops/sec
Pure JS Class Selector 51543.7 Ops/sec
Pure JS Data Hook 46792.0 Ops/sec
jQuery ID Selector 50206.9 Ops/sec
jQuery Class Selector 46575.6 Ops/sec
jQuery Data Hook Selector 38670.6 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS ID Selector

  • Pure JS Class Selector

  • Pure JS Data Hook

  • jQuery ID Selector

  • jQuery Class Selector

  • jQuery Data Hook Selector