Run details:
Mozilla/5.0 (Linux; Android 11; CPH2065) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.88 Mobile Safari/537.36
Chrome Mobile 91
Android
Mobile
3 years ago
Test name Executions per second
Traverse function 35604.7 Ops/sec
NodeIterator with filter function 4799.4 Ops/sec
NodeIterator with filter param 139461.4 Ops/sec
TreeWalker with filter function 11482.4 Ops/sec
TreeWalker with filter param 214839.0 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param