Run details:
Mozilla/5.0 (Linux; Android 11; Pixel 3a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36
Chrome Mobile 90
Android
Mobile
3 years ago
Test name Executions per second
Traverse function 24865.1 Ops/sec
NodeIterator with filter function 5235.1 Ops/sec
NodeIterator with filter param 148664.3 Ops/sec
TreeWalker with filter function 14046.2 Ops/sec
TreeWalker with filter param 168660.6 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param