Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Chrome 100
Windows
Desktop
2 years ago
Test name Executions per second
hasAttribute 2266967.8 Ops/sec
getAttribute 2543154.8 Ops/sec
classList 2518886.8 Ops/sec
hasAttribute single 2865987.5 Ops/sec
getAttribute single 2570806.0 Ops/sec
classList single 3072231.5 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single