Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.42
Chrome 108
Windows
Desktop
2 years ago
Test name Executions per second
hasAttribute 4468576.0 Ops/sec
getAttribute 4409245.5 Ops/sec
classList 4161004.5 Ops/sec
hasAttribute single 4849144.5 Ops/sec
getAttribute single 4265570.0 Ops/sec
classList single 4414276.0 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single