IronPython 2.0 is slow to execute code
IronPython 2.0.1 seems to execute the script file about 3x slower than IronPython 1.x. I'm not sure if this is not what I'm doing, so I'm wondering if others have similar experiences.
I have a 200k python script that takes 5 seconds to execute from a file on IP 1.x and almost 18 seconds on IP 2.0.1!
a source to share
There are certain things in IronPython that are much slower than in Python. This often happens because you are doing a weird corner case in your implementation. It's worth trying to boil it down to a very simple script that shows the difference in performance and posts this to the IronPython mailing list - the developers are very responsive.
There was a series of interesting blog posts recently published on IronPython performance - this is a good overview . The bottom line is that you can get very good performance once you avoid the pitfalls, and the IP team is very keen to learn about these issues and fix them quickly. Narrowing down reproduction to find the trap is the hardest part - once you've developed what triggers the behavior that is usually easy to work around.
a source to share
I also had a similar problem when I started using IronPython 2.0. The problem for me was the gloomy startup time for the DLR. When the runtime is loaded, the performance of the script is fast enough.
To reduce startup time at runtime, you can try NGENs using binaries . This reduced the startup time by about 60% for me.
Even with this fix, he still doesn't speak as fast. If your script doesn't do a lot, it will still take up a significant portion of the total time to run. Hopefully the DLR team will fix the launch issues soon.
a source to share
You can read the IronPython article : Reusing Import Symbols to Prevent Performance Crashes That Can Speed Up Inline Scripting.
a source to share