I have written about the performance of iterating directories before, in the context of Java and its switch from version 6 to 7 that brought with it the new Java NIO API. For whatever reason I felt the urge to do something similar again, but this time I wanted to compare two different approaches to recursively scanning a directory’s contents:
- Use recursive function calls (a function that calls itself over and over again for each directory)
- Use an iterative approach (a function keeps a list of directories and iterates this list)
To make things more interesting, I implemented this in C++ using the Windows API and the Qt framework, in C# in combination with its buddy the .NET framework and, for good measure, I also threw in the old Java code from over a year ago.
Update (26.12.2014): I added additional data at the bottom of the article.
Read More »