Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0
Firefox 98
Linux
Desktop
2 years ago
Test name Executions per second
Traverse function 26041.1 Ops/sec
NodeIterator with filter function 8305.9 Ops/sec
NodeIterator with filter param 92502.0 Ops/sec
TreeWalker with filter function 20456.0 Ops/sec
TreeWalker with filter param 115067.8 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param