Run details:
Mozilla/5.0 (Linux; Android 9) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/8.0.15 Chrome/75.0.3770.101 Mobile Safari/537.36
Chrome Mobile 75
Android
Mobile
5 years ago
Test name Executions per second
Traverse function 48491.9 Ops/sec
NodeIterator with filter function 8730.9 Ops/sec
NodeIterator with filter param 240139.8 Ops/sec
TreeWalker with filter function 23796.1 Ops/sec
TreeWalker with filter param 308957.5 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param