I need to fix my demo and I will post when done. I built a db that spans a directory and logs the files to a table then displays the files in a treeview. I have a button to do the span using FSO or DIR. In my testing the DIR was about 2-5 times faster and the bigger the number of files and directories the bigger the difference. I did not see anything approaching 1000x times. However I did nothing more than 23k files so with 100k or M files maybe you could get up there. The difference in speed is not linear.
I think at my max test of 23k files and 1k sub directories the difference was about 90 s versus 500 sec. (since I am logging the files a lot of that time is in the logging but should be comparitive).
The problem I found with DIR is that it is very unforgiving. If you throw an error it is really hard to continue where you left off and it throws some weird errors. For example it will find a file but then you check the attributes and it will say file not found. I think you can return a file with a path name with bad characters but you cannot then read that path in another function.
Some of my problem is explained here and why it is hard to continue if you throw an error.
If Len(Dir(FullPath)) > 0 Then 'the file exists. This potential bug patiently waits to pounce and ruin another poor programmer's day.
nolongerset.com
Now his fix is not really a dir fix since the solution is to incorporate some FSO.
So I agree DIR is faster, but it is hard to make it work without errors and then continuing from those errors.