example code
you have:
objectA{
public string aProperty{
get{
...
}
set{
...
}
}
}
then
private bool ItemIncluded(ObjectA aItem){
aItem.aProperty.Contains("SomeString");
}
list<ObjectA> result = AllObjects<ObjectA>.FindAll(ItemIncluded);
where AllObjects contains 200 000 entries (or more)
when I use the above described method it is unacceptably slow... is
there a faster way to search strings and as you notice aProperty thus
I can not assume that the value of aProperty is constant or does not
change a lot.

Search a big generic list for an occurence of a string.
lathajith
mydatatable.Columns["aProperty"].Expression = "aProperty LIKE '*aa*'";
or something like that. The idea is that since you're looking for text search, a datatable would probably be a better option (of course, you'll need to try it out before concluding :))
hope that helps..
Imran.
mhagman
Imran.
BugInfested
I have found a serious bottleneck in my test setup... performance is now quit good.
I think I am going to leave it like that develop some more and see how performance it holds. Its an application that doesnt really need to be scalable....
The thing I want to be able to do is exactly like the search function in iTunes and that one is reaaly fast....
Steven Mooses
If you have a known set of keywords, then when you add an object to list, you can index it on the keywords, e.g.,
Each keyword is a key in a Hashtable.
The value of the key is an ArrayList which contains the objects that contain the keyword in their aProperty.
When you add an object to the list, scan the string for each keyword, adding the object to the appropriate keyword ArrayList.
When you search on a keyword, check whether the object is on the appropriate keyword ArrayList (BinarySearch).
You have thereby reduced your search space from the total number of objects, to the number of objects on the keyword ArrayList.
vefan
you can consider it more like a keyword to search on
luvzlabz
Sayhan
By analogy to relational databases, you need to identify a suitable key on which you can search. Is there some part of aProperty which can act as a key
Then you could use a System.Collections.Hashtable type to store your objects against the key.
lbeham
so I can not sort on the name property because otherwise if I change it that means I have to rebuild whole my list.
I do not think there is anyway of avoiding to iterate through whole the list. If i search on a boolean property it works quick only the strings are causing problems.