Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
Chrome 80
Linux
Desktop
4 years ago
Test name Executions per second
Traverse function 29770.9 Ops/sec
NodeIterator with filter function 5166.8 Ops/sec
NodeIterator with filter param 249815.6 Ops/sec
TreeWalker with filter function 21062.0 Ops/sec
TreeWalker with filter param 237526.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