Run details:
Mozilla/5.0 (Linux; Android 9; ANE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.105 Mobile Safari/537.36
Chrome Mobile 89
Android
Mobile
3 years ago
Test name Executions per second
Traverse function 12771.9 Ops/sec
NodeIterator with filter function 2621.5 Ops/sec
NodeIterator with filter param 86049.2 Ops/sec
TreeWalker with filter function 7225.4 Ops/sec
TreeWalker with filter param 91409.6 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param