Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/80.0.3987.95 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 80
iOS 13.3
Mobile
4 years ago
Test name Executions per second
Traverse function 147766.6 Ops/sec
NodeIterator with filter function 36887.1 Ops/sec
NodeIterator with filter param 533729.8 Ops/sec
TreeWalker with filter function 65305.6 Ops/sec
TreeWalker with filter param 624820.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