Using Predicate of a class to Search Generic list - Faster than looping?

Posted by Srikanth on Stack Overflow See other posts from Stack Overflow or by Srikanth
Published on 2010-05-01T17:17:49Z Indexed on 2010/05/01 17:27 UTC
Read the original article Hit count: 125

Filed under:
|
|
|

Lets say we have a generic list of Class1, typically having ~100 objects for a given session. I would like to see if the list has a particular object. ASP.NET 2.0 allows me to do this:

Dim objResult as Class1 = objList.Find(objSearch)

How does this approach rate when compared to a traditional For loop, looking at a performance perspective?

How would this vary with increase or decrease in length of the list?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about generic