LINQ To Objects and the performance of nested "Where" calls
This post came out of this Stack Overflow question, which essentially boils down to which is better out of these two options: var oneBigPredicate = collection.Where(x => Condition1(x) && Condition2(x) && Condition3(x)); var multiplePredicates = collection.Where(x => Condition1(x)) .Where(x => Condition2(x)) .Where(x => Condition3(x)) The first case is logically a single "wrapper" sequence around the original collection, with a filter which checks all three conditions (but applying short-circuiting logic, of course) before the wrapper will yield an item from the original sequence. The second case is logically a set of concentric wrapper sequences, each applying a … Continue reading LINQ To Objects and the performance of nested "Where" calls