It's a speed-space tradeoff.
If your Select()
callback is computationally expensive, you probably want to computer it once and store it for later.
If not, you probably want to save on storage and compute it every time.
If you need random access, you should definitely call ToList()
, because ElementAt()
is O(n).
Note that ToList()
is faster than ToArray()
, because ToArray()
needs to trim the array after it finishes.