Run details:
Mozilla/5.0 (Linux; Android 8.0.0; LDN-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36
Chrome Mobile 83
Android 8.0.0
Mobile
4 years ago
Test name Executions per second
Traverse function 8049.5 Ops/sec
NodeIterator with filter function 1575.0 Ops/sec
NodeIterator with filter param 54121.6 Ops/sec
TreeWalker with filter function 4323.9 Ops/sec
TreeWalker with filter param 57146.6 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param