|go ahead... be a heretic|
Re: List of directory (3 ways)by radiantmatrix (Parson)
|on Jan 17, 2006 at 20:11 UTC||Need Help??|
I think your results are so surprising because your benchmark code adds a lot of unneccessary cruft to the different approaches. For example, in method 1 you're instantiating my $file at every pass through the loop.
FWIW, here's my benchmark of approach 1 (iterative) vs. approach 3 (slurpy):
As you can see, the iterative approach is *much* faster in my benchmark.
My test on my home OSX machine:
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet