<div><br></div>I used the most simple &quot;Hello World&quot; program as a benchmark for &quot;bare bones&quot; Python __initialization__...nothing more.<div><br></div><div>On my pc, the &quot;Hello World&quot; script obviously executes very quickly....so trying to open 160 odd files that don&#39;t exist is negligible, but it still happens.</div>
<div><br></div><div> &quot;...How did you measure that?...&quot;</div><div>I used &quot;strace -c hello.py&quot;</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">&lt;<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>&gt;</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, &quot;hello world&quot; isn&#39;t exactly the benchmark I&#39;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 &quot;Hello World&quot; .... 78% of the<br>
overall execution time is spent opening files....most of which don&#39;t exist.<br>
</blockquote>
<br></div>
How did you measure that?<br>
<br>
I&#39;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&#39;s a bit of overhead to call into the OS, and I don&#39;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&#39;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>