Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Chrome 89
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
parent.children() 4768954.0 Ops/sec
parent.find("> *") 26730240.0 Ops/sec
parent.children(".child") 1075493.9 Ops/sec
parent.find("> .child") 26701402.0 Ops/sec
parent.children("span") 1059820.4 Ops/sec
parent.find("> span") 26423270.0 Ops/sec
parent.children("[data-attr=value]") 883793.1 Ops/sec
parent.find("> [data-attr=value]") 26395476.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]")