From the number of emails that drop into my inbox, you'd think that nothing could be easier. In the case of program execution, though, the criteria are a bit less clear.
Because the purpose of my project is to look at the performance of .NET code under Windows and Linux, I've been looking into what other people have done. What I have found is not conclusive, but it is interesting.
Firstly, we have to define what we mean by performance in this context. Most people would agree that we are talking about speed of execution; but under what circumstances? The test application that I have been using tries to simulate a real-life situation, but most benchmark tests set out to test specific aspects of code execution performance. In particular, tests exist to measure the performance of:
- ArrayList building
- StringBuilder manipulation
- Integer and floating point addition
- Exception handling
- Recursion and reflection
One of the difficulties in this particular scenario is that there are a large number of combinations of variables. We can check, for each test:
- Static vs non-static execution
- Windows vs Linux
- Mono-compiled code vs .NET Framework compiled code
- Mono virtual machine vs .NET Framework virtual machine
A student at the University of Wisconsin, called John Tertin, has done some interesting work, and his results are published on the Web. They seem to show that, on the Windows platform, the fastest configuration is Mono on Windows; which is a very surprising result. The worst-performing scenario is running .NET Framework compiled code on the Mono virtual machine.
Interestingly, Mono always outperforms the .NET Framework on exception handling; regardless of the compiler or the virtual machine. I can't imagine why this should be.
All this would suggest that in my experiment you would expect to see the Windows program out-performing the Mono (Linux) one. Early indications are, however, that this is not the case. There appear to be many other things that determine performance apart from the raw speed of the compiler and the runtime environment. It's not all about raw speed and power.
True on so many levels ...



