I have some bad performance issues in my application. One of the big operations is comparing strings. I download a list of strings, approximately 1000 - 10000. These are all unique strings. Then I need to check if these strings already exists in the database. The linq query that I'm using looks like this:
IEnumerable<string> allNewStrings = DownloadAllStrings();
var selection = from a in allNewStrings
where !(from o in context.Items
select o.TheUniqueString).Contains(a)
select a;
Am I doing something wrong or how could I make this process faster preferably with Linq?
Thanks.