tags:

views:

42

answers:

2

Consider the following A list of approximately 10,000 folders Of these folders, a list of rules determine if they qualify to go to the next stage The rules are a text based comparison such that if folder name contains (...any of the following from a list of exceptions) - such that there is a one to many comparison for each folder, but the folder name string must contain (or must NOT contain) any of the strings it is compared do

I'm relatively new to C# so I'm not entirely sure what's under the hood of each class

Any advice in some general direction would be greatly appreciated.

+2  A: 

Do you have a performance problem, or are you trying to optimize the code before it has been written?

The Comparer class is typically not the topmost performant class of the .NET framework, but it has to cater for quite a lot of scenarios.

If you know the source and target types, you're usually better off implementing your own specific comparer class.

However, unless you know that you have a performance problem, I wouldn't worry too much about it.

Lasse V. Karlsen
A: 

First of 10 K folders is not a large number... So you might not want to worry about performance already.

So dont optimize...

After that you might want to consider the way you search your names... Instead of a seach for every single element, you could create a regexp that will perform all searches at once, but that is optimization without a real need...

First you need a reason to change the code

Heiko Hatzfeld