Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36
Chrome 91
Windows
Desktop
3 years ago
Test name Executions per second
parent.children() 1086037.0 Ops/sec
parent.find("> *") 9417195.0 Ops/sec
parent.children(".child") 629774.5 Ops/sec
parent.find("> .child") 9227417.0 Ops/sec
parent.children("span") 628095.6 Ops/sec
parent.find("> span") 8690215.0 Ops/sec
parent.children("[data-attr=value]") 293838.7 Ops/sec
parent.find("> [data-attr=value]") 8691210.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]")