Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
parent.children() 14317371.0 Ops/sec
parent.find("> *") 55418736.0 Ops/sec
parent.children(".child") 3562537.5 Ops/sec
parent.find("> .child") 55895648.0 Ops/sec
parent.children("span") 3473153.8 Ops/sec
parent.find("> span") 56139824.0 Ops/sec
parent.children("[data-attr=value]") 2494749.5 Ops/sec
parent.find("> [data-attr=value]") 56045988.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]")