<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Sep 17, 2018 at 9:23 PM, Carl Shapiro <span dir="ltr"><<a href="mailto:carl.shapiro@gmail.com" target="_blank">carl.shapiro@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 dir="ltr"><span class="">On Sun, Sep 16, 2018 at 1:24 PM, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></span> wrote:<br></span><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think it's of limited interest if it only helps with modules used<br>
during the startup sequence, not arbitrary stdlib or third-party<br>
modules.<br></blockquote><div><br></div></span><div>This should help any use-case that is already using the freeze module already bundled with CPython.  Third-party code, like py2exe, py2app, pyinstaller, and XAR could build upon this to create applications that start faster.</div></div></div></div></blockquote><div><br></div><div><div style="color:rgb(0,0,0)" class="gmail_default">I think this seems like a great idea.<br></div></div><div><br></div><div><div style="color:rgb(0,0,0)" class="gmail_default">Some questions though:</div><br></div><div></div><div><div style="color:rgb(0,0,0)" class="gmail_default">During the import process, Python can already deal with folders and .zip files in sys.path... now, instead of having special handling for a new concept with a custom command line, etc, why not just say that this is a special file (e.g.: files with a .pyfrozen extension) and make importlib be able to deal with it when it's on sys.path (that way there could be multiple of those and there should be no need to turn it on/off, custom command line, etc)?</div><div style="color:rgb(0,0,0)" class="gmail_default"><br></div><div style="color:rgb(0,0,0)" class="gmail_default">Another question: doesn't importlib already provide hooks for external contributors which could address that use case? (so, this could initially be available as a third party library for maturing outside of CPython and then when it's deemed to be mature it could be integrated into CPython -- not that this can't happen on Python 3.8 timeframe, but it'd be useful checking its use against the current Python version and measuring benefits with real world code).<br></div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To give an idea, on my machine the baseline Python startup is about 20ms<br>
(`time python -c pass`), but if I import Numpy it grows to 100ms, and<br>
with Pandas it's more than 200ms.  Saving 4ms on the baseline startup<br>
would make no practical difference for concrete usage.<br></blockquote><div><br></div></span><div>Do you have a feeling for how many of those milliseconds are spend loading bytecode from disk?  If so standalone executables that contain numpy and pandas (and mercurial) would start faster</div><span class=""><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm ready to think there are other use cases where it matters, though.<br></blockquote><div><br></div></span><div>I think so.  I hope you will, too :-) </div></div></div></div>
<br>______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/fabiofz%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>fabiofz%40gmail.com</a><br>
<br></blockquote></div><br></div></div>