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 21755.9 Ops/sec
NodeIterator with filter function 4317.7 Ops/sec
NodeIterator with filter param 145592.4 Ops/sec
TreeWalker with filter function 11588.1 Ops/sec
TreeWalker with filter param 162122.9 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param