Run details:
Mozilla/5.0 (Linux; Android 5.1; OPPO F1S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.74 Mobile Safari/537.36
Chrome Mobile 95
Android 5.1
Mobile
8 months ago
Test name Executions per second
Traverse function 7236.9 Ops/sec
NodeIterator with filter function 1409.4 Ops/sec
NodeIterator with filter param 49028.8 Ops/sec
TreeWalker with filter function 3532.8 Ops/sec
TreeWalker with filter param 57373.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