Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_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.1
Mobile
one year ago
Test name Executions per second
Traverse function 238594.0 Ops/sec
NodeIterator with filter function 91493.0 Ops/sec
NodeIterator with filter param 1867416.5 Ops/sec
TreeWalker with filter function 235924.6 Ops/sec
TreeWalker with filter param 1975961.9 Ops/sec
Script Preparation code:
Tests:
  • Traverse function

  • NodeIterator with filter function

  • NodeIterator with filter param

  • TreeWalker with filter function

  • TreeWalker with filter param