Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15
Safari 14
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
parent.children() 3978521.0 Ops/sec
parent.find("> *") 47580468.0 Ops/sec
parent.children(".child") 1342124.5 Ops/sec
parent.find("> .child") 47858268.0 Ops/sec
parent.children("span") 1283860.8 Ops/sec
parent.find("> span") 48698480.0 Ops/sec
parent.children("[data-attr=value]") 1106389.9 Ops/sec
parent.find("> [data-attr=value]") 48824744.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]")