To yield or not yield

Some time ago, Chris Massey challenged everyone to discuss about four interesting .NET performance questions. One of those questions was “When processing some data into a list, is it faster to build up a collection and return it as an enumerator, or use yield to create the enumerator ‘on the fly’?“.

Well, I also post a little contribution and surprisingly my post was one of the winners, so I won a free license to ANTS Profiler 4.

2 Replies to “To yield or not yield”

  1. Yes, it was a great contribution that you made to the discussion. All the questions were slightly tricky, which was why we chose them. We started out trying to think of simple questions with ‘Yes/No’ answers. Impossible, we discovered. Then we tried questions where we thought there was one simple answer. The trouble was that Andrew and Bart kept saying ‘well that depends…’. Then we hit on the idea of choosing questions where we all said ‘Heck, that depends…’. I hope you enjoyed the competition as much as we did! I guarantee that you’ll love the ANTS 4 prize. Andrew, Bart and the lads are all very proud of ANTS 4.

Leave a Reply

Your email address will not be published. Required fields are marked *