I need to count the elements of a list/set having property with given value. The list is huge and I need the performance as good as possible. Should I use a list or a set (when having unique elements)? Is there any faster way?
int counter = myList.Where(x => x.A == myValue || x.B == myValue).Count()
This is already inside of AsParallel().ForAll()
for another huge list. And no, I can't change that.
Edit
I already saw this question and it does definitely not solve my problem, I am interested on the differences in (P)LINQ queries.