the question I got recently was that for-each will outperform Linq and PLinq as well. So I have conducted a few experiments and the result quite the opposite as I expected.
One of the issues has been raised in legacy systems is how to optimize for performance knowing there are several limitations. This mindset, however, gives the green light to ignore many modern language features on the argument that it lowest the performance of the application. I think that is not true and sometimes it the reason for bad performance is implementing new language features the wrong way.
so, the question I got recently was that for-each will outperform Linq and PLinq as well. So I have conducted a few experiments and the result quite the opposite as I expected.
See the details in my github: https://github.com/Haadka/functional-c-sharp