Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Linux
Desktop
9 months ago
Test name Executions per second
Traverse function 138668.7 Ops/sec
NodeIterator with filter function 15841.1 Ops/sec
NodeIterator with filter param 882771.8 Ops/sec
TreeWalker with filter function 44440.5 Ops/sec
TreeWalker with filter param 1055704.2 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param