Run details:
Mozilla/5.0 (iPad; CPU OS 13_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/77.0.3865.103 Mobile/15E148 Safari/605.1
Chrome Mobile iOS 77
iOS 13.1
Tablet
5 years ago
Test name Executions per second
Traverse function 32115.8 Ops/sec
NodeIterator with filter function 7598.7 Ops/sec
NodeIterator with filter param 289828.5 Ops/sec
TreeWalker with filter function 20656.6 Ops/sec
TreeWalker with filter param 344579.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