Run details:
Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Firefox/102.0
Firefox 102
FreeBSD
Desktop
2 years ago
Test name Executions per second
parent.children() 5307685.0 Ops/sec
parent.find("> *") 27363806.0 Ops/sec
parent.children(".child") 2438810.0 Ops/sec
parent.find("> .child") 27464090.0 Ops/sec
parent.children("span") 2465515.8 Ops/sec
parent.find("> span") 27355612.0 Ops/sec
parent.children("[data-attr=value]") 1972565.8 Ops/sec
parent.find("> [data-attr=value]") 27526520.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]")