Run details:
Mozilla/5.0 (Linux; Android 9; HTC U11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36
Chrome Mobile 83
Android
Mobile
4 years ago
Test name Executions per second
Traverse function 29330.0 Ops/sec
NodeIterator with filter function 6115.7 Ops/sec
NodeIterator with filter param 170989.3 Ops/sec
TreeWalker with filter function 15783.0 Ops/sec
TreeWalker with filter param 213243.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