Friday, May 08, 2009

A Fairly Meaningless Server Performance Comparison

An interesting article by James Gardner comparing the performance of IronPython, Jython, Scala and CPython for serving web pages. Not only does it carry the usual caveats of all benchmarking and performance comparisons, but the version of IronPython used is the very old IronPython 2.0 Alpha 5 which still comes with Mono.

UPDATE: it turns out that not only is the article using an old version of IronPython, but it advises installing Mono 1.9.1 because of the handy universal installer for Linux. Whilst this is indeed handy it is also outdated (the installer used to be built with a tool called BitRock which is non-free). The latest version of Mono is 2.4.

That aside it is still an interesting read and includes instructions on how to get Mono installed and have IronPython working with the Python standard library on Linux:
IronPython 2.0 is a full implementation of Python 2.5 targetting the .NET platform and yet it can be very hard to find good instructions on how to set it up because not all distributions of Mono include IronPython 2 and those that do might not include the Python standard library so I thought I'd put some instructions up on how to do it.

Once it was running I thought it would be interesting to benchmark a simple WSGI Hello World! server to see if it is faster than ordinary Python. That got me wondering about Jython which in turn got me wondering about Scala. The upshot is that I have instructions for installing all 3 and running a simple benchmark on each, along with a pure-Python version for reference. Before long I was experimenting with Java Servlets on Tomcat too!

Hopefully the instructions on setting up the examples and how to run them will be useful, even if the benchmarks aren't.


I found the experimenting really interesting. IronPython and Jython, whilst very impressive projects didn't have the performance I expected, particularly after having heard rumours that IronPython sometimes out-performed Python. Those times must be fairly few and far between. I was also astonished by the speed of Scala and Java and was very interested in the Java eco-system which, once you get through all the marketting, has some very sensible products.

Out of IronPython, Jython and Scala the one I am now most interested in is Jython which would allow me access to all the interesting Java software that exists for "enterprise" applications whilst giving me the flexibility of Python and access to all my existing code, albiet for a performance penalty which as I mentioned at the start of this post, doesn't hugely really affect most well-written real world applications anyway.
Mono includes IronPython 1 and IronPython 2.0 Alpha 5 as these are the versions provided by FePy the community distribution of IronPython which can be compiled by Mono. (It might have been interesting to see these benchmarks run with IronPython 1 as I think it might have fared better than this version of IronPython 2.)

Interestingly the precompiled Windows binaries of IronPython 2.0.1 run fine on Mono (although the interactive interpreter interacts with the shell in a weird way). Unfortunately there is still a problem with the source code / Mono C# compiler which means that you can't compile recent versions with Mono.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.