Wednesday, 4 September 2013

Optimizing the Generic List WHERE

Optimizing the Generic List WHERE

The statement below takes around 6 seconds to produce the output when the
SecurityInfoMasterList has around 11,000 items and listClassiNode has
around 750 items.
Is there any other way of doing this to achieve the same result but with
better performance?
List<SecurityInfo> listSecurityInfo =SecurityInfoMasterList.Where(c =>
listClassiNode.Any(d => c.SX == d.Exch && c.Instrument ==
d.Instrument)).ToList();
I have been trying to use for loop but didnt see much improvement.
Alan

No comments:

Post a Comment