Run details:
Mozilla/5.0 (Linux; Android 11; Pixel 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.61 Mobile Safari/537.36
Chrome Mobile 101
Android
Mobile
2 years ago
Test name Executions per second
Traverse function 26396.4 Ops/sec
NodeIterator with filter function 5538.6 Ops/sec
NodeIterator with filter param 173600.8 Ops/sec
TreeWalker with filter function 15161.0 Ops/sec
TreeWalker with filter param 205695.8 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param