The stupid question is the question not asked | |
PerlMonks |
Re: List of directory (3 ways)by radiantmatrix (Parson) |
on Jan 17, 2006 at 20:11 UTC ( [id://523824]=note: print w/replies, xml ) | 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:
Updates:
<-radiant.matrix->
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
In Section
Meditations
|
|