Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
Chrome 94
Windows 7
Desktop
3 years ago
Test name Executions per second
parent.children() 2836027.5 Ops/sec
parent.find("> *") 12580106.0 Ops/sec
parent.children(".child") 793139.1 Ops/sec
parent.find("> .child") 12569836.0 Ops/sec
parent.children("span") 803938.6 Ops/sec
parent.find("> span") 12683144.0 Ops/sec
parent.children("[data-attr=value]") 609551.3 Ops/sec
parent.find("> [data-attr=value]") 12695474.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]")