Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15
Safari 15
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
parent.children() 3492069.2 Ops/sec
parent.find("> *") 37707660.0 Ops/sec
parent.children(".child") 1449546.8 Ops/sec
parent.find("> .child") 37968480.0 Ops/sec
parent.children("span") 1439080.1 Ops/sec
parent.find("> span") 37302808.0 Ops/sec
parent.children("[data-attr=value]") 1239385.4 Ops/sec
parent.find("> [data-attr=value]") 38894792.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • parent.children()

  • parent.find("> *")

  • parent.children(".child")

  • parent.find("> .child")

  • parent.children("span")

  • parent.find("> span")

  • parent.children("[data-attr=value]")

  • parent.find("> [data-attr=value]")