Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Firefox 132
Linux
Desktop
2 months ago
Test name Executions per second
Traverse function 1348292.4 Ops/sec
NodeIterator with filter function 212990.4 Ops/sec
NodeIterator with filter param 2468216.2 Ops/sec
TreeWalker with filter function 472741.4 Ops/sec
TreeWalker with filter param 1907503.5 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param