Why IEnumerable slow and List is fast?
This is because of deferred execution: the enumeration is produced by evaluating the sequence of filters for each item. When you do a ToList
, however, the sequence is "materialized" in memory, so all the evaluations are performed exactly once.