[IronPython] IronPython Start-up Time

Dino Viehland dinov at exchange.microsoft.com
Tue Jul 17 18:21:18 CEST 2007

It's a great time to bring this up because I'm currently investigating various start-up time issues and trying to improve our startup time.  I'll give you a breakdown of what I've discovered so far:

                Various reflection that we do over types:
                                This includes over modules (SystemState, built-ins, re, etc...)
                                Over types for creating "DynamicType"s: object, string, PythonFile, etc... - these are the types we need to startup and display the logo.
                JITing methods:
                                Not on hello world, but on a more complex scenario, I know we JIT 2500 methods on startup on the desktop CLR (this is loading the Python version of the chess API shown at MIX - but not actually running it).  Obviously that's going to take some time too.  W/o an ngen's mscorlib we'll JIT something like 4000 methods.

There's also some little things here and there but my numbers show JITing is representing around 70% of our startup time.  Being as fast as CPython might be tough but we certainly want to do better than where we are.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of C L
Sent: Tuesday, July 17, 2007 2:10 AM
To: users at lists.ironpython.com
Subject: [IronPython] IronPython Start-up Time


playing around a bit with IronPython I noticed that the start-up time is
quite long

Something around ~12s for the initial launch and around ~3,5s for each following
launch executing
    import sys
with IronPython-2.0A2\ipy.exe (on a Core Duo 2Ghz 2GB)

I am not complaining, just curious.
Is this simply because loading the CLR/DLR takes so much time?
And what is with the 3.5s for successive start-ups?

For comparison CPython needs ~2s for the initial and
~0.2s for successive start-ups.


Btw I used the simple C++ program
// Compile with
//    cl /Feuxtime.exe /EHsc uxtime.cpp
//    uxtime.exe "PATH_TO_IronPython\ipy.exe simplyExit.py"
#include <stdio.h>
#include <ctime>
#include <stdlib.h >

int main( int argc, char**argv)
    int c_start = clock();
    system( argv[1]);
    int c_end = clock();
    printf("%d\n", ((double)(c_end - c_start)) / CLOCKS_PER_SEC );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070717/a55b4ac2/attachment.html>

More information about the Ironpython-users mailing list