<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br>
Of course, you still have the actual interpretation of<br>
the top-level module code - if it&#39;s not the marshalling<br>
but this part that actually costs performance, this<br>
efficient marshalling algorithm won&#39;t help. It would be<br>
interesting to find out which modules have a particularly<br>
high startup cost - perhaps they can be rewritten</blockquote><div><br></div><div>I am afraid this is the case. I hope we could marshal an arbitary application state (not even Python specific) into a fast loading dump file (hibernation/snapshot).</div>
<div><br></div><div>We have tried to use lazy importing as much as possible to distribute the importing cost across the application UI states.</div><div><br></div><div>Out of my head I know at least two particular module which could be refactored. I&#39;d recommend as the&nbsp;best practice that everything should be imported lazily if it&#39;s possible. However, looks like currently Python community is moving to another direction, since doing explict imports in __init__ etc. makes APIs cleaner (think Django) and debugging more sane task - Python is mainly used on the server and limited environments haven&#39;t been particular interesting until lately.</div>
<div><br></div><div>logging - defines lots of classes which are used only if they are specified by logging options. I once hacked this for my personal use to be little lighter.</div><div><br></div><div>urllib - particular heavy, imports httplib, ftplib and stuff even if it is not used</div>
<div><br></div><div>Nokia has just released Python 2.5 based PyS60. I think we&#39;ll come back this after a while with a nice generic profiler which will tell the import cost.</div><div>&nbsp;</div><div>Merry XMas,</div><div>
-Mikko</div></div>