views:

763

answers:

1

I've been using IronPython for a while now, but something which really hampers my development with it is that it is excruciatingly slow to start up. I love the language and it's way of working, but it is frustrating to have to wait upqards of 20 seconds before it starts executing my code.

I have done some digging and it seems to be that the problem is not with the importing, but before that stage.

Thanks.

+13  A: 

We're working on fixing this in 2.6. You can download Beta 1 today and you'll probably see a much improved startup time.

The problem is that most of the time is generally spent JITing code. It's especially pronounced if you're on a 64-bit machine because the 64-bit is slower. In 2.6 we now delay compiling things until they're actually run the first time, interpret them if they're only needed once or twice, and we've moved a bunch of code we'd generate at runtime into IronPython.dll so it too benefits from ngen. The bigger the app the bigger an improvement you'll probably see from all of these changes.

If you didn't check the ngen option when installing IronPython you can go back and ngen it from the command line by doing "ngen install ipy.exe". ngen.exe is in C:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe or C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe if you're on a 64-bit machine. But it needs to be an administrator command prompt. That'll give you some benefits today on the stable version. If you're on 64-bit you'll need to do this even if you checked the box - there's a bug that was preventing ngen from working correctly on 64-bit.

Dino Viehland
I'll take a look later tonight at 2.6. I have had some bad experiences with ngen in the past (ahem.. TOAD) so I unticked this during install - I'll run that too! Thanks.
Lucas Jones
I'm glad to hear that this is being worked on. I use IronPython extensively and that is my #1 problem with it.
Stargazer712