Ironpython experience

L

Lev

I'm an on and off Python developer and use it as one of the tools.
Never for writing "full-blown" applications, but rather small, "one-of-
a-kind" utilities. This time I needed some sort of backup and
reporting utility, which is to be used by the members of our team
once or twice a day. Execution time is supposed be negligible. The
project was an ideal candidate to be implemented in Python. As
expected the whole script was about 200 lines and was ready in a 2
hours (the power of Python!).Then I downloaded Ironpython and
relatively painlessly (except the absence of zlib) converted the
Python code to Ironpython. Works fine and Ironython really is Python.
But...

The CPython 2.6 script runs 0.1 seconds, while Ironpython 2.6 runs
about 10 seconds. The difference comes from the start-up, when all
these numerous dlls/assemblies are loaded and JITed.

Is there any way to speed up the process.
 
D

Dino Viehland

Lev said:
I'm an on and off Python developer and use it as one of the tools.
Never for writing "full-blown" applications, but rather small, "one-of-
a-kind" utilities. This time I needed some sort of backup and
reporting utility, which is to be used by the members of our team
once or twice a day. Execution time is supposed be negligible. The
project was an ideal candidate to be implemented in Python. As
expected the whole script was about 200 lines and was ready in a 2
hours (the power of Python!).Then I downloaded Ironpython and
relatively painlessly (except the absence of zlib) converted the
Python code to Ironpython. Works fine and Ironython really is Python.
But...

The CPython 2.6 script runs 0.1 seconds, while Ironpython 2.6 runs
about 10 seconds. The difference comes from the start-up, when all
these numerous dlls/assemblies are loaded and JITed.

Is there any way to speed up the process.

Can you give us more information about the environment you're running
in? E.g. how did you install IronPython, is this on 32-bit or 64-bit
and are you using ipy.exe or ipy64.exe?

The sweet spot to be in is on a 32-bit machine or a 64-bit machine
and using ipy.exe. You should also be using ngen'd (pre-compiled)
binaries which the MSI does for you. Combining 32-bit plus ngen
should greatly reduce startup time and typically on our test machines
it only takes a couple of seconds (http://ironpython.codeplex.com/wiki...y26Perf&referringTitle=IronPython Performance).

That's still a lot worse than CPython startup time but it's much
better than 10 seconds. We also continue to work on startup time -
there's already some big improvements in our Main branch which should
be showing up in 2.6.1. Matching CPython is still a long ways off
if we ever can do it but do intend to keep on pushing on it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top