Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0
Firefox 123
Linux
Desktop
8 months ago
Test name Executions per second
Traverse function 783258.1 Ops/sec
NodeIterator with filter function 97582.1 Ops/sec
NodeIterator with filter param 1216348.9 Ops/sec
TreeWalker with filter function 238818.1 Ops/sec
TreeWalker with filter param 1006956.1 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param