[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: fastest way of looping through directories

Yohanes Santoso

7/10/2006 2:29:00 PM

"Thomas Coopman" <thomas.coopman@gmail.com> writes:

> I'm looking for the fastest way for looping through directories.
>
> at the moment i'm using Find but when I test this, the first time it runs
> really slow (like 20 seconds) the second time it runs much much quicker

Find is about the fastest way. The bottleneck is in the I/O.
There is not much you can do about that beside getting a better
disk subsytem.

The reason it was faster the second time is because your OS had cached
the information.

If the list of entries are fixed or do not change much, you can try
saving them in a file, so subsequent runs do not have to traverse
through the directories again.

YS.