Fast find object by string property
- by Andrew Kalashnikov
Hello, colleagues.
I've got task to fast find object by its string property.
Object:
class DicDomain
{
public virtual string Id{ get; set; }
public virtual string Name { get; set; }
}
For storing my object I use List[T] dictionary where T is DicDomain for now .
I've got 5-10 such lists, which contain about 500-20000 at each one.
Task is find objects by its Name.
I use next code now:
List<T> entities = dictionary.FindAll(s => s.Name.Equals(word, StringComparison.OrdinalIgnoreCase));
I've got some questions:
Is my search speed optimal. I think now.
Data structure. It List good for this task. What about hashtable,sorted...
Method Find. May be i should use string intern??
I haven't much exp at these tasks. Can u give me good advice for increase perfomance.
Thanks