Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_7_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1
Mobile Safari 16
iOS 16.7.2
Mobile
2 months ago
Test name Executions per second
Traverse function 171147.0 Ops/sec
NodeIterator with filter function 57953.2 Ops/sec
NodeIterator with filter param 1068493.4 Ops/sec
TreeWalker with filter function 155427.9 Ops/sec
TreeWalker with filter param 1347361.5 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param