Run details:
Mozilla/5.0 (Linux; Android 10; Mi A3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36
Chrome Mobile 85
Android
Mobile
4 years ago
Test name Executions per second
Traverse function 16759.3 Ops/sec
NodeIterator with filter function 3415.3 Ops/sec
NodeIterator with filter param 110863.9 Ops/sec
TreeWalker with filter function 9112.2 Ops/sec
TreeWalker with filter param 124107.0 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param