Click to See Complete Forum and Search --> : optimisation question


Mikky
May 5th, 2003, 07:09 PM
I have recursive function that need to search through all directories on
all fixed volumes on system.
This operation must be performed as fastest as possible, so as we know
hard disk speed here is bottle neck, so I was thinking and here are my two ideas

1. straigh forward recursing, meaning lets first scan drive c:\
then D:\ etc.. until no more fixed volumes, this means that
scanning drive d:\ will start not until c:\ is done

2. enumerate all fixed drives on system and for each of them
create separate thread with this recurse function. this means
that all fixed volumes will be scanned at the same time


now, by my logical I think that way 2 is definetly faster
when you have two physical hard disks, but is it faster when
there is one hdd which is separated on two logical partitions?
Windows recognizes logical partitions just as they are physically different
hard disks, so my program does not have chance to determine if certain
fixed volume is logical or physical hard disk

any thoughts/tips/suggestions on this is very appreciated :)

Kdr Kane
May 6th, 2003, 01:03 AM
This is just an opinion.

But, method 2 will be slower. You will wind up making your drives, drive heads, interface ports and the operating system continually reinitializing as each thread starts back where it left off. Hope that makes sense.

And it will still be slower if you have two hard disks unless you have them on separate controllers. A slave/master combo on the same controller will "thrash" with two threads to some small degree.

Couldn't you just rely on or enable the Indexing Service - or implement something similar to it?