Run details:
Mozilla/5.0 (Linux; Android 9; VKY-L29 Build/HUAWEIVKY-L29; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.101 Mobile Safari/537.36 [FB_IAB/Orca-Android;FBAV/223.0.0.11.119;]
Chrome Mobile 75
Android
Mobile
5 years ago
Test name Executions per second
Traverse function 32927.6 Ops/sec
NodeIterator with filter function 6854.5 Ops/sec
NodeIterator with filter param 196026.8 Ops/sec
TreeWalker with filter function 18223.2 Ops/sec
TreeWalker with filter param 247261.1 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param