Run details:
Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Windows
Desktop
one year ago
Test name Executions per second
Traverse function 317660.9 Ops/sec
NodeIterator with filter function 60916.8 Ops/sec
NodeIterator with filter param 899128.4 Ops/sec
TreeWalker with filter function 134195.9 Ops/sec
TreeWalker with filter param 700423.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