Run details:
Mozilla/5.0 (Linux; Android 9; VOG-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36
Chrome Mobile 75
Android
Mobile
5 years ago
Test name Executions per second
Traverse function 47782.7 Ops/sec
NodeIterator with filter function 8524.8 Ops/sec
NodeIterator with filter param 246592.9 Ops/sec
TreeWalker with filter function 23241.2 Ops/sec
TreeWalker with filter param 315359.4 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param