Run details:
Mozilla/5.0 (Linux; Android 8.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Mobile Safari/537.36
Chrome Mobile 98
Android 8.0.0
Mobile
2 years ago
Test name Executions per second
Traverse function 6323.2 Ops/sec
NodeIterator with filter function 826.1 Ops/sec
NodeIterator with filter param 45276.7 Ops/sec
TreeWalker with filter function 2173.8 Ops/sec
TreeWalker with filter param 44691.3 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param