Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.70 Safari/537.36 OPR/76.0.4017.59 (Edition beta)
Opera 76
Windows
Desktop
3 years ago
Test name Executions per second
Traverse function 62129.8 Ops/sec
NodeIterator with filter function 12688.2 Ops/sec
NodeIterator with filter param 366300.2 Ops/sec
TreeWalker with filter function 34635.1 Ops/sec
TreeWalker with filter param 455289.6 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param