Redblack tree enumerator

May 17, 2009 at 11:02 PM

I've noticed significant memory growth when you enumerate the items in a large redblack tree (e.g. OrderedBag with millions of items). From what I can tell, it seems like the yield return pattern is pretty heavy weight when used with recursion. I imagine that the compiler created state objects are to blame for the growth. I ended up implementing a different enumerator that doesn't use the yield return and has no memory growth. Is this a known issue? any plans to address?