Run details:
Mozilla/5.0 (Linux; Android 11; SM-G981N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.181 Mobile Safari/537.36
Chrome Mobile 88
Android
Mobile
3 years ago
Test name Executions per second
Traverse function 32205.0 Ops/sec
NodeIterator with filter function 3155.5 Ops/sec
NodeIterator with filter param 219261.9 Ops/sec
TreeWalker with filter function 9110.9 Ops/sec
TreeWalker with filter param 258604.7 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param