<div><br></div>I used the most simple "Hello World" program as a benchmark for "bare bones" Python __initialization__...nothing more.<div><br></div><div>On my pc, the "Hello World" script obviously executes very quickly....so trying to open 160 odd files that don't exist is negligible, but it still happens.</div>
<div><br></div><div> "...How did you measure that?..."</div><div>I used "strace -c hello.py"</div><div><br></div><div>This is not a dig at Python, I love Python....I was asking if I had missed a compile option or implementation trick.</div>
<div><br></div><div><br></div><div>Bruce</div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Thu, Mar 24, 2011 at 5:05 PM, Stefan Behnel <span dir="ltr"><<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">bruce bushby, 24.03.2011 16:58:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My main concern was that a freshly compiled Python attempts to open 168<br>
non-existent files before starting.<br>
<br>
I understand that an interpreted language is probably not the best choice<br>
for an embedded device<br>
</blockquote>
<br></div>
Well, "hello world" isn't exactly the benchmark I'd use for an embedded system.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On my desktop pc, when I run the most simple "Hello World" .... 78% of the<br>
overall execution time is spent opening files....most of which don't exist.<br>
</blockquote>
<br></div>
How did you measure that?<br>
<br>
I'd expect that after the first startup, most of the relevant parts of the file system are cached by the OS, so a subsequent run should be quick as all file existence tests will run from memory. Sure, it's a bit of overhead to call into the OS, and I don't know how expensive that is on ARM-Linux, but given that you also claim it to be expensive on your desktop, I must say that I'm a bit surprised about your above claim.<br>
<br>
Stefan<br>
<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/bruce.bushby%40gmail.com" target="_blank">http://mail.python.org/mailman/options/python-dev/bruce.bushby%40gmail.com</a><br>
</blockquote></div><br></div>