<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Mar 24, 2011, at 4:06 AM, bruce bushby wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>I have previously asked this question in python-list, however I think it belongs here.</div></span></blockquote><div><br></div><div>As the saying goes, this list is for development <i>of</i> python, not <i>with</i> python. So it would be appropriate to make a suggestion as to some direction for Python's development that would improve your situation.</div><div><br></div><div>That said, at one point I had similar issues, and I also thought that Python should have had some kind of "embedded mode" compilation options, and I never found anything.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>I'm running python 2.7.1 on an embedded Linux board and noticed it takes 1.8 seconds to execute the most simple "Hello World" script.</div></span></blockquote><br></div><div>You will notice that very, very early on in the process (not quite the first thing, but almost), there is a stat for python27.zip. You want to put absolutely everything in the standard library into that archive, and to put your shared objects into /usr/lib/python2.7/ with names like 'foo.so' (not 'foomodule.so', as that's statted second).</div><div><br></div><div>When I was working with embedded python, that was pretty much the whole story: 2 zip files (one for the stdlib, one for everything else in my application), one directory for extension modules. Finally, I hacked site.py to set sys.path to just those three entries, so that even failed imports would not stat too many non-existent files.</div><div><br></div><div>I think it would be a great idea to have a configure flag that instructed python to be pre-built this way, but I don't work with embedded pythons these days, so I'm not likely to do it :).</div><div><br></div><div><br></div></body></html>