Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36
Chrome 91
Windows 7
Desktop
3 years ago
Test name Executions per second
hasAttribute 632376.0 Ops/sec
getAttribute 526245.9 Ops/sec
classList 590073.7 Ops/sec
hasAttribute single 682326.9 Ops/sec
getAttribute single 586647.2 Ops/sec
classList single 792275.2 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single