Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Mobile/15E148 Safari/604.1
Mobile Safari 16
iOS 16.1
Mobile
one year ago
Test name Executions per second
Traverse function 223279.7 Ops/sec
NodeIterator with filter function 84256.4 Ops/sec
NodeIterator with filter param 1672974.0 Ops/sec
TreeWalker with filter function 216385.1 Ops/sec
TreeWalker with filter param 1801050.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