Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
Chrome 86
Windows 7
Desktop
4 years ago
Test name Executions per second
Pure JS ID Selector 13489.2 Ops/sec
Pure JS Class Selector 13793.3 Ops/sec
Pure JS Data Hook 13478.3 Ops/sec
jQuery ID Selector 12780.6 Ops/sec
jQuery Class Selector 10555.5 Ops/sec
jQuery Data Hook Selector 9027.8 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