Run details:
Mozilla/5.0 (Linux; Android 10; SM-G975F) 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 36039.1 Ops/sec
NodeIterator with filter function 7102.1 Ops/sec
NodeIterator with filter param 243644.6 Ops/sec
TreeWalker with filter function 19695.4 Ops/sec
TreeWalker with filter param 262208.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