Run details:
Mozilla/5.0 (X11; CrOS x86_64 13020.38.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.42 Safari/537.36
Chrome 83
Chrome OS 13020.38.0
Desktop
4 years ago
Test name Executions per second
Traverse function 27518.7 Ops/sec
NodeIterator with filter function 6699.8 Ops/sec
NodeIterator with filter param 185133.4 Ops/sec
TreeWalker with filter function 18094.6 Ops/sec
TreeWalker with filter param 198176.3 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param