Search blog.co.uk

Archives for: March 2006

Improve your performance

by cc0028 @ 2006-03-15 - 09:54:29

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
So I've been running some simple versions of these tests found from the Web and analysing the results.

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
or any combination of these.

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 ...


 
 

So close... So close...

by cc0028 @ 2006-03-11 - 19:14:25

Yes, so close. Barely seven weeks to go before the dissertation must be delivered. And is it really over a week since I posted here?

Since then, with my experimental Web application up and running, there have been - so far - 126 responses. I doubt very much that I'll get as many as that during the next week. So it looks as though there will be a sample size of about 150 by the time the pages get taken down. This is just slightly on the disappointing side, but should be perfectly adequate for what the experiment is trying to show.

Early results suggest that there is no significant difference between the two implementations, Linux and Microsoft .NET.

And once more I find myself indebted to a colleague at the university (UWIC) where I work. UWIC has an extremely strong Podiatry Department and the IT department shares a corridor with its staff. One of the Podiatry Department's staff members, Dr Iain Mathieson, has been a constant source of encouragement to me over the years I've been studying for this degree. Iain has responsibility for the Podiatry Department's Masters degree students and so has an interest in what makes the difference between success and failure on courses of this type. He is also one of life's great enthusiasts.

When asked last week if he could give me some advice on the statistical analysis of my results, he was delighted to help. I haven't studied statistics since leaving university after my first degree, in 1968, and statistics was never my favourite subject even then. It was just something you had to do to make sense of your results. Iain, though, still managed to make this dry subject interesting and thanks to him I have a much clearer idea both of what is required in an analysis of the kind I'm doing, and how to present it.

This is good, because the last part of my experiment fell into place today.

As well as collecting data from the Web application I am also collecting it from an automatic upload procedure that, obviously, doesn't suffer from the vagueries of human data entry. I was going to run this procedure from the Administration side of my Web application, but today I decided that this would not be necessary. So I've written a console-based application that uploads many thousands of student records from an XML file, and does so several million (yes million) times. The whole procedure takes something like twenty minutes to run, and this is the figure that is recorded in the database. The console application will run the procedure for a given number of times, creating that many records in the database.

I plan to install this application on both of my servers.

The week after next, when I have finished actively collecting manual data entry information, I will set the console applications running on both servers. They will be configured to run the procedure one hundred times. So they should keep going for about thirty-three hours. It will be interesting to see if there is any difference between the Linux and the Windows virtual machines in terms of the time it takes to run the same code on each of them.

I was also fortunate enough to find some performance comparison code by a guy called Eugen Anghel. The code is posted on his blog. I will also run this code and check the results, because the tests Eugen includes provide data about specific aspects of .NET processing. I'm looking forward to seeing how that turns out.

So there we are. Seven weeks to go. Are we nervous? Yes, a little.

And rest ...

by cc0028 @ 2006-03-02 - 22:01:16

You know, there are times in the computer business when you think that you will never get through all the problems and produce anything useful. Everything you do just seems to create another problem. Every turn you take turns out to be a blank end. Then all of a sudden you solve something that appeared to be relatively minor and all the other pieces just fall into their places.

I should take to heart what my colleague Richard tells me. "It'll get sorted one way or the other. We haven't met anything yet we failed to fix"; and he's absolutely correct. It's hard to keep telling yourself that, though, when everything seems to be going wrong and you can't work out why.

Ten days ago I wasn't sure at all that I'd ever be able to deploy my experiment properly. Today I can be secure in the knowledge that it's all running perfectly and exactly to specification. Why, I ask myself? Really, the only thing that happened was that I installed the correct version of mod_mono. That was all it took. Since then, it's all been plain sailing.

So that's it. If you want to do the experiment, click on the link below and follow the instructions:

http://linmono.uwic.ac.uk/starter

One word of warning. The instructions that are on the server at the moment do not contain the correct link (i.e. the one above); and they have been altered slightly in their latest version to make them a bit clearer, I hope. The main body of the instructions is correct though - the data that I want people to enter. The new instructions will be on the server tomorrow morning.

Please feel free to have a go. The more who do, the merrier.

I can rest now, and let my users do the work for a couple of weeks.

Through the Windows

by cc0028 @ 2006-03-01 - 19:54:19

Just a quick update ...

Thanks to the unfailing efforts of my friends in our Systems and Comms Department (Craig and Mark), I now have the Windows version of my applications up and running:

This is the Windows version
This is the Linux version

All I need to do now is to add the startup application that will redirect users to different versions on a random basis. It will be the URL of that application that I will want users to visit, not either of the ones above, which will be the ones to which they will be redirected. Once that is available I can start asking people to perform the experiment.


 
 

Footer

The content of this website belongs to a private person, blog.co.uk is not responsible for the content of this website.