Run details:
Mozilla/5.0 (iPad; CPU OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1
Mobile Safari 12
iOS 12.4.1
Tablet
5 years ago
Test name Executions per second
Traverse function 115485.9 Ops/sec
NodeIterator with filter function 38142.5 Ops/sec
NodeIterator with filter param 830784.6 Ops/sec
TreeWalker with filter function 101156.4 Ops/sec
TreeWalker with filter param 1026926.2 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param