It depends on how you use it and what you are comparing.
I have seen many implementations using foreache , which would be much faster with linq. For instance. because they forget to break or because they return too many items. The trick is that lambda expressions execute when an element is actually used. When you have First at the end, it can only lead to one call.
Therefore, when you bind Where s, if the element does not pass the first condition, it will also not be checked for the second condition. it is similar to the && operator, which does not evaluate the condition on the right side if the first is not satisfied.
We can say that it is always O (N). But N is not the number of elements in the source, but the minimum number of elements needed to create the target set. This is a pretty good optimization IMHO.
source share