CWuestefeld: to be fair, when dealing with x86 applications, you very rarely need a lot of speed (hurts saying this, being an old assembly coder and all) - so native vs. managed often isn't going to matter a lot speed-wise. Memory overhead of managed apps is usually somewhat higher, which also isn't much of a problem on x86. Embedded is a different story, though
Also, JITted platforms has the
possibility of outperforming native code (because of dynamic runtime analysis) - I just haven't seen this happen yet, seems like there still is a lot of research to be done in the JIT field.
How can you say that the 2nd benchmark outperforms C code, btw? He clearly shows that the C# compiler is somewhat retarded compared to the C compiler he uses, and ends up having to unroll the C# code to even get near to the performance of the C code (which he hasn't unrolled, btw...) - loop unrolling makes things a lot less readable. You can btw pretty much dismiss the non-optimized native results entirely. Why would you
not turn on optimization for native code? (except for some cases of debugging).
And lastly, the benchmark is sorta flawed - he doesn't mention which C compiler he uses, doesn't mention the optimization settings, and the samples are very simplistic (I would have expected dotNET to do a lot better with such simple code).