Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36
Chrome 88
Mac OS X 10.13.6
Desktop
3 years ago
Test name Executions per second
Traverse function 61294.9 Ops/sec
NodeIterator with filter function 11033.5 Ops/sec
NodeIterator with filter param 421884.2 Ops/sec
TreeWalker with filter function 30815.6 Ops/sec
TreeWalker with filter param 494340.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