Run details:
Mozilla/5.0 (Linux; Android 10; H8324) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36
Chrome Mobile 96
Android
Mobile
3 years ago
Test name Executions per second
Traverse function 37011.0 Ops/sec
NodeIterator with filter function 6851.7 Ops/sec
NodeIterator with filter param 226634.1 Ops/sec
TreeWalker with filter function 18625.9 Ops/sec
TreeWalker with filter param 272488.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