Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/81.0.4044.92 Chrome/81.0.4044.92 Safari/537.36
Chromium 81
Linux
Desktop
4 years ago
Test name Executions per second
Traverse function 50658.1 Ops/sec
NodeIterator with filter function 10293.4 Ops/sec
NodeIterator with filter param 297067.1 Ops/sec
TreeWalker with filter function 27695.0 Ops/sec
TreeWalker with filter param 286902.8 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param