Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IronPython performance

I'm considering embedding IronPython as a scripting language for an application that I'm writing. So to try it out, I downloaded IronPython 2.0 and fired up the interactive interpreter. Just starting the thing up takes about 5 seconds on my Intel Quad Core with 6 Gigs of memory. I can hardly imagine how much of a delay this would be for a less powerful machine.

Based on these benchmarks, it seems as though IronPython's performance actually isn't too terribly bad. Or is it? Have I misconfigured something during installation? Or is this a problem with the interactive interpreter?

like image 999
Jason Baker Avatar asked Feb 08 '09 17:02

Jason Baker


People also ask

Is IronPython slow?

IronPython is slower because of DLR (dynamic language runtime) that it is built on.

Is IronPython still supported?

As of today (22 July), IronPython 2.7. 4 for Python 2.7 is the most current stable version. Any news re Python 3 support? @RBV - github.com/IronLanguages/ironpython3 appears to be the official IronPython 3 repo.

Should I use IronPython?

One of the largest benefits of IronPython is that it has (effectively) no GIL - meaning that if you are both writing Python code and it is multi-threaded - you can often get performance that is better than CPython without having to spawn multiple process and pickle objects across the boundaries.

Is IronPython the same as Python?

Python is Python, the only difference is that IronPython was designed to run on the CLR (. NET Framework), and as such, can inter-operate and consume . NET assemblies written in other .


1 Answers

IronPython's performance is really quite good. The startup performance penalty that you get has got to do with the .NET runtime. .NET applications generally have a slow startup time because a lot of assemblies get loaded and some of them (at least some classes) get compiled on the fly.

This is expected behaviour in .NET. Actual runtime performance is much better. Even startup performance can be improved by pre-compiling the IronPython assembly and putting a copy in the GAC: global assembly cache of your machine. This can be done using the gacutil.exe.

like image 94
Konrad Rudolph Avatar answered Sep 23 '22 15:09

Konrad Rudolph