Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0
Firefox 93
Linux
Desktop
2 years ago
Test name Executions per second
Traverse function 154171.0 Ops/sec
NodeIterator with filter function 35873.3 Ops/sec
NodeIterator with filter param 704324.2 Ops/sec
TreeWalker with filter function 91160.8 Ops/sec
TreeWalker with filter param 501096.7 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param