<div dir="ltr">Help me out here.&nbsp; I have seen many references to schemes to optimize import speeds on Iron Python. Isn&#39;t this an attempt to make up for the snail-like startup speeds suffered by <b>all</b> .net applications? It seems to me that when Iron Python finally starts running, it imports and performs very well. The slowdown is in getting the .net engine started. Try comparing startup times for &quot;Hello World&quot; in C Python and Iron.<br>
&nbsp;&nbsp; It is my experience that I can identify .net programs in general by the fact that I have double-clicked its desktop icon three times (thinking I had missed it somehow) before the first instance displays its splash screen, and then the next two display an &quot;already running&quot; dialog. <br>
Any chance of getting the .net people to help out with this?<br>--<br>Vernon Cole<br><br><div class="gmail_quote">On Mon, Oct 13, 2008 at 10:00 AM, Dino Viehland <span dir="ltr">&lt;<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">This is all still on 1.x, right? &nbsp;It looks like #1 is fixed in 2.0 (we are locking but on the wrong object in 1.x).<br>

<br>
#2 is still broken in 2.x though as well.<br>
<div><div></div><div class="Wj3C7c"><br>
-----Original Message-----<br>
From: <a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>] On Behalf Of Kamil Dworakowski<br>

Sent: Monday, October 13, 2008 4:45 AM<br>
To: <a href="mailto:users@lists.ironpython.com">users@lists.ironpython.com</a><br>
Subject: [IronPython] parallel importing<br>
<br>
Importing time is such a pain that I wanted to do it in parallel on<br>
many threads. I figured that if the modules where imported in such a<br>
way that:<br>
<br>
no two threads import the same module at the same time<br>
<br>
everything would be fine. To ensure that condition, it is enough to<br>
build a dependency graph and import based on that.<br>
<br>
I did it: Resolver One start up time improved by 20% on a two-core<br>
machine. But it crashes, surprisingly on single core machines it is<br>
more often (6 crashes on 200 starts).<br>
<br>
So far I have identified two causes for crashes:<br>
<br>
1. One thread imports a module with class B inside while another is<br>
importing a module with class C inside. If B and C are subclasses of<br>
A, it can result in IndexOutOfRangeException being raised, when, under<br>
the hood, IronPython.Runtime.Types.DynamicType.AddSubclass is being<br>
executed.<br>
<br>
2. Attributes on .NET modules are loaded lazily, so importing<br>
namespaces only is not enough. Attribute getting from reflected<br>
packages is not thread safe. Looks like I would have to import every<br>
class explicitly (would that be enough?).<br>
<br>
Second cause would be pretty easy to address, but I&#39;m not so sure<br>
about the first one. Are there any more potential points of problems?<br>
I am beginning to think I was to optimistic about all of this<br>
importing on multiple cores, but if these are the only ones it could<br>
probably be still fixed.<br>
<br>
If anyone is interested the code for it is on github:<br>
<a href="http://github.com/luntain/ipy-parallel-import" target="_blank">http://github.com/luntain/ipy-parallel-import</a>.<br>
<br>
--<br>
Kamil Dworakowski<br>
Resolver Systems Ltd.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br></div>