Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
Chrome 79
Linux
Desktop
4 years ago
Test name Executions per second
Traverse function 54778.0 Ops/sec
NodeIterator with filter function 6520.3 Ops/sec
NodeIterator with filter param 308191.2 Ops/sec
TreeWalker with filter function 20493.8 Ops/sec
TreeWalker with filter param 363337.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