Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Chrome 92
Windows
Desktop
3 years ago
Test name Executions per second
hasAttribute 3279020.8 Ops/sec
getAttribute 3117964.8 Ops/sec
classList 3167352.2 Ops/sec
hasAttribute single 3918234.5 Ops/sec
getAttribute single 3051769.2 Ops/sec
classList single 3291783.2 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single