Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
Chrome 90
Windows
Desktop
3 years ago
Test name Executions per second
parent.children() 4980581.5 Ops/sec
parent.find("> *") 21609372.0 Ops/sec
parent.children(".child") 1232391.4 Ops/sec
parent.find("> .child") 21918088.0 Ops/sec
parent.children("span") 1226173.2 Ops/sec
parent.find("> span") 21842180.0 Ops/sec
parent.children("[data-attr=value]") 1003505.6 Ops/sec
parent.find("> [data-attr=value]") 21464768.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]")


;