Run details:
Mozilla/5.0 (Linux; Android 4.4.2; SM-T531) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Chrome 81
Android 4.4.2
Tablet
2 years ago
Test name Executions per second
Traverse function 3810.2 Ops/sec
NodeIterator with filter function 647.0 Ops/sec
NodeIterator with filter param 26663.9 Ops/sec
TreeWalker with filter function 1631.8 Ops/sec
TreeWalker with filter param 27622.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