Run details:
Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Mobile Safari/537.36
Chrome Mobile 93
Android
Mobile
3 years ago
Test name Executions per second
Traverse function 39379.1 Ops/sec
NodeIterator with filter function 3254.9 Ops/sec
NodeIterator with filter param 169981.8 Ops/sec
TreeWalker with filter function 8587.1 Ops/sec
TreeWalker with filter param 249245.2 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param