Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Windows 7
Desktop
3 months ago
Test name Executions per second
Traverse function 104602.9 Ops/sec
NodeIterator with filter function 26974.7 Ops/sec
NodeIterator with filter param 331767.5 Ops/sec
TreeWalker with filter function 63906.4 Ops/sec
TreeWalker with filter param 198866.0 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param