I would say that this belongs to the category of premature optimization. If, after installing the tests, you find that the code is too slow, you can always try each approach and choose the result that works best for you.
Since we donโt know how IEnumerable<> , itโs hard to say which approach will work best. We also donโt know how many elements will remain after applying your predicate - and we donโt know whether action or iteration steps will be the dominant factor in the execution of your code. The only way to know for sure is to try in both directions, profile the results and choose the best one.
Performance aside, I would choose the most understandable version, which (for me) is the first filter, and then apply the projection to the result.
source share