Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Chrome 81
Windows
Desktop
4 years ago
Test name Executions per second
hasAttribute 1862053.5 Ops/sec
getAttribute 1860548.5 Ops/sec
classList 1909786.5 Ops/sec
hasAttribute single 2071023.0 Ops/sec
getAttribute single 1848872.4 Ops/sec
classList single 2486293.0 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single