Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Chrome 81
Mac OS X 10.15.7
Desktop
4 years ago
Test name Executions per second
hasAttribute 2002218.8 Ops/sec
getAttribute 1954522.1 Ops/sec
classList 2157115.0 Ops/sec
hasAttribute single 2378040.8 Ops/sec
getAttribute single 2064751.8 Ops/sec
classList single 2785865.5 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single