Run details:
Mozilla/5.0 (Linux; Android 11; Nokia 5.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Mobile Safari/537.36
Chrome Mobile 92
Android
Mobile
3 years ago
Test name Executions per second
Traverse function 21742.0 Ops/sec
NodeIterator with filter function 4302.6 Ops/sec
NodeIterator with filter param 142372.5 Ops/sec
TreeWalker with filter function 11498.7 Ops/sec
TreeWalker with filter param 162811.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