Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.5000.0 Iron Safari/537.36
Chrome 98
Windows 7
Desktop
one year ago
Test name Executions per second
.attribute 1659835.6 Ops/sec
setAttribute/removeAttribute 970198.9 Ops/sec
setAttributeNode/removeAttributeNode 734339.9 Ops/sec
attributes.setNamedItem/attributes.removeNamedITem 565330.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • .attribute

  • setAttribute/removeAttribute

  • setAttributeNode/removeAttributeNode

  • attributes.setNamedItem/attributes.removeNamedITem