The performance of WalkDir is improved by replacing the recursive DFS
with a stack based implementation (less memory in-use during peak
exploration). In addition, some unnecessary flags and options were
removed which allowed the code to be overall simplified. Much less rule
matching is occuring with the same files returned.
Some performance results on my linux host:
small repo:
- 649 files returned by walkDir()
- 9 .gitignore files
- walkDir() old vs new duration: 918 ms to 143 ms
medium sized repo:
- 9271 returned by walkDir()
- 35 .gitignore files
- walkDir() old vs new duration: 10,886 ms to 970ms
large sized repo:
- 197,900 files returned by walkDir()
- 929 .gitignore files
- walkDir() old vs new duration: 498,151 ms to 37,353 ms
Co-authored-by: Rob Leidle <rleidle@tesla.com>