Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36
Chrome 102
Windows
Desktop
2 years ago
Test name Executions per second
hasAttribute 3967048.2 Ops/sec
getAttribute 3947155.2 Ops/sec
classList 3904840.8 Ops/sec
hasAttribute single 4459558.5 Ops/sec
getAttribute single 4031664.2 Ops/sec
classList single 4879780.0 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single