<br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 18:26, Alex Gaynor <span dir="ltr"><<a href="mailto:alex.gaynor@gmail.com">alex.gaynor@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Brett Cannon <brett <at> <a href="http://python.org" target="_blank">python.org</a>> writes:<br>
<br>
<br>
> IOW you want the sys.modules case fast, which I will never be able to match<br>
compared to C code since that is pure execution with no I/O.<br>
><br>
<br>
<br>
</div>Sure you can: have a really fast Python VM.<br>
<br>
Constructive: if you can run this code under PyPy it'd be easy to just:<br>
<br>
$ pypy -mtimeit "import struct"<br>
$ pypy -mtimeit -s "import importlib" "importlib.import_module('struct')"<br>
<br>
Or whatever the right API is.</blockquote><div><br></div><div>I'm not worried about PyPy. =) I assume you will just flat-out use importlib regardless of what happens with CPython since it is/will be fully compatible and is already written for you. </div>
</div>