Consider using yield return

Developer
Dec 11, 2010 at 12:10 PM

As far as I have seen Orchard operates on lots of enumerables - from route tables to item lists. I guess it would be quite of a performance boost (in terms of memory usage, especially in more complex sites) to rewrite the crucial IEnumerable<T>-returning methods to use yield return instead of building the whole object to return at once.

Of course there are some drawbacks when using yield return, but it's still worth considering.

Cheers