Test the performance of TreeWalker compared to other DOM walker methods. Ran each test 1000 times. Try it yourself.
Method Total ms Average ms
document.TreeWalker 911 0.911
Iterative Traverser 2945 2.945
Recursive Traverser 69521 69.521
XPath query 4996 4.996
querySelectorAll 12860 12.86
getElementsByTagName 1929 1.929
Method Total ms Average ms
document.TreeWalker 597 0.597
Iterative Traverser 1287 1.287
Recursive Traverser 10542 10.542
XPath query 2995 2.995
querySelectorAll 2769 2.769
getElementsByTagName 311 0.311
Method Total ms Average ms
document.TreeWalker 6404 6.404
Iterative Traverser 3706 3.706
Recursive Traverser 8838 8.838
XPath query 21041 21.041
querySelectorAll 2815 2.815
getElementsByTagName 182 0.182
Nice man, thanks for putting all the work into this.