Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.39
Chrome 112
Windows
Desktop
one year ago
Test name Executions per second
hasAttribute 4121649.5 Ops/sec
getAttribute 4029344.5 Ops/sec
classList 3902549.2 Ops/sec
hasAttribute single 4691848.5 Ops/sec
getAttribute single 4105284.8 Ops/sec
classList single 4091991.8 Ops/sec
HTML Preparation code:
Tests:
  • hasAttribute

  • getAttribute

  • classList

  • hasAttribute single

  • getAttribute single

  • classList single