Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
Chrome 98
Windows
Desktop
2 years ago
Test name Executions per second
parent.children() 6348467.0 Ops/sec
parent.find("> *") 28982040.0 Ops/sec
parent.children(".child") 1816862.9 Ops/sec
parent.find("> .child") 28219774.0 Ops/sec
parent.children("span") 1766019.5 Ops/sec
parent.find("> span") 28609484.0 Ops/sec
parent.children("[data-attr=value]") 1417553.0 Ops/sec
parent.find("> [data-attr=value]") 29193200.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]")