Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
Chrome 86
Linux
Desktop
4 years ago
Test name Executions per second
Traverse function 69396.9 Ops/sec
NodeIterator with filter function 10989.3 Ops/sec
NodeIterator with filter param 523027.9 Ops/sec
TreeWalker with filter function 30358.3 Ops/sec
TreeWalker with filter param 493618.6 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param