<br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 17:42, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</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">On Tue, 7 Feb 2012 17:24:21 -0500<br>
Brett Cannon <<a href="mailto:brett@python.org">brett@python.org</a>> wrote:<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>
</div>Why wouldn't continue using C code for that? It's trivial (just a dict<br>
lookup).<br></blockquote><div><br></div><div> Sure, but it's all the code between the function call and hitting sys.modules which would also need to get shoved into the C code. As I said, I have not tried to optimize anything yet (and unfortunately a lot of the upfront costs are over stupid things like checking if __import__ is being called with a string for the module name).</div>
</div>