Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36
Chrome 94
Windows
Desktop
3 years ago
Test name Executions per second
parent.children() 7123938.0 Ops/sec
parent.find("> *") 28631606.0 Ops/sec
parent.children(".child") 1950115.8 Ops/sec
parent.find("> .child") 28943526.0 Ops/sec
parent.children("span") 1806651.1 Ops/sec
parent.find("> span") 27099102.0 Ops/sec
parent.children("[data-attr=value]") 1486638.5 Ops/sec
parent.find("> [data-attr=value]") 28962952.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]")