Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
Chrome 84
Windows
Desktop
4 years ago
Test name Executions per second
hasAttribute 1876436.6 Ops/sec
getAttribute 1828698.2 Ops/sec
classList 1907166.2 Ops/sec
hasAttribute single 2218393.0 Ops/sec
getAttribute single 1880411.8 Ops/sec
classList single 2563681.5 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single