Windows Vista + Indexing + .NET Framework

Soldato
Joined
12 Jun 2005
Posts
5,361
Hi there,

Was unsure whether this should be in this forum or the Windows forum, so please feel free to move if needed.

Does .NET programs take advantage of the indexing that Windows Vista has integrated.

For instance, if i wanted to iterate through all the files in a folder, would it be faster if Windows Vista indexing service had them indexed.

Thanks.
 
I would speculate that having the indexing service enabled wouldn't affect the performance of "normal" file I/O operations.

From my understanding the indexing service maintains "catalogs" that act as indexes into the filesystem, and those can be queried from .NET using the MSIDXS provider i.e. to take advantage of indexing you would have to explicity access the catalogs. Not sure that this would help with your scenario though.

Alas, as I say, I can't back this speculation up with any hard evidence ;)
 
Last edited:
I would speculate that having the indexing service enabled wouldn't affect the performance of "normal" file I/O operations.

From my understanding the indexing service maintains "catalogs" that act as indexes into the filesystem, and those can be queried from .NET using the MSIDXS provider i.e. to take advantage of indexing you have to explicity access the catalogs. Not sure that this would help with your scenario though.

Alas, as I say, I can't back this speculation up with any hard facts ;)

So you are saying - without vista-specific coding, it would NOT take advantage of the indexing system.

The only reason i ask is because i am thinking of disabling it for my HTPC, but uses Media Portal (a .NET Application)
 
So you are saying - without vista-specific coding, it would NOT take advantage of the indexing system.
I can't say conclusively, but that would be my best guess - at least to say "Indexing Service specific" rather than "Vista specfic", as the indexing service is also supported on some of the other M$ platforms.

I'm still having a look round to see what I can find out, as it is an interesting question, and I'll post again if I find anything.
 
Last edited:
Surely Vista's indexing service only helps with finding the location of files on a hard disk (or finding the contents)?

If you're iterating through the files in a folder you already know the location so why would it be any quicker?
 
For instance, if i wanted to iterate through all the files in a folder, would it be faster if Windows Vista indexing service had them indexed.
No.

If you drill down in Reflector, you'll find that DirectoryInfo.GetFiles() eventually calls into FindFirstFile and FindNextFile in kernel32. This is at a lower level than the indexing stuff.

One thing you could do is switch it off and measure the performance difference. I'd personally disable everything unpredictable like indexing on a media center machine in any case, even if searching for files was a bit slower.
 
Back
Top Bottom