List<T>.ForEach vs foreach(…)
A thread came up yesterday on the C# newsgroup about when to use the “normal” foreach and when to use List<T>.ForEach (assuming, of course, that one is dealing with a List<T> in the first place). Obviously there are readability issues, but we ended up focusing on performance. (Isn’t that telling in its own right? How often is the iteration part rather than the body going to dominate and be a significant bottleneck? Anyway, I digress.) So, I wrote a small benchmark, and Patrick asked me to blog about it. I’ve refactored the test I posted on the newsgroup and added … Continue reading List<T>.ForEach vs foreach(…)