Run details:
Mozilla/5.0 (Linux; Android 10; Redmi Note 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Mobile Safari/537.36
Chrome Mobile 86
Android
Mobile
4 years ago
Test name Executions per second
Traverse function 23111.6 Ops/sec
NodeIterator with filter function 4422.8 Ops/sec
NodeIterator with filter param 144085.7 Ops/sec
TreeWalker with filter function 12913.9 Ops/sec
TreeWalker with filter param 160251.4 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param