<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, 22 Jun 2017 at 16:26 Bhavishya <<a href="mailto:bhavishyagopesh@gmail.com">bhavishyagopesh@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Also I saw your conversation with "Brett Cannon" on lazy-loading some modules at  startup, and also doing so using ModuleProxy(also several implementations that exist like <a href="https://docs.python.org/3/library/importlib.html?highlight=lazy%20import#importlib.util.LazyLoader.factory" target="_blank">importlib's Lazyloader</a>, <a href="http://peak.telecommunity.com/DevCenter/Importing" target="_blank">PEAK</a> ).<br></div>So your suggestion's on this too?<br></div></div></div></div></div></blockquote><div><br></div><div>As stated earlier, if you wish to discuss seeing if lazy loading will help in Python's startup performance then please start a thread over at <a href="mailto:speed@python.org">speed@python.org</a> and we can discuss it there.</div><div><br></div><div>-Brett</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div></div><br></div>Thank You<br> <br></div>regards,<br></div>Bhavishya<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 22, 2017 at 7:24 PM, Bhavishya <span dir="ltr"><<a href="mailto:bhavishyagopesh@gmail.com" target="_blank">bhavishyagopesh@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"><div><div><div><div><div>Hello,<br></div><div>1)I might be totally wrong here, but even if we go with stripping annotation(in .pyc)...still the "lag" that comes from ABCs needs to be addressed.<br></div><div><br><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_MTextBody m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_content"><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_body m_-3723783428582046146m_-2609348240607948757gmail-markdown-body" dir="auto">2) I been reading for past few days about your <code class="m_-3723783428582046146m_-2609348240607948757gmail-hljs">fat-optimizer</code> project and the corresponding <code class="m_-3723783428582046146m_-2609348240607948757gmail-hljs m_-3723783428582046146m_-2609348240607948757gmail-autoit"><span class="m_-3723783428582046146m_-2609348240607948757gmail-hljs-keyword">TO</span>-<span class="m_-3723783428582046146m_-2609348240607948757gmail-hljs-keyword">DO</span></code> list, if you think that <code class="m_-3723783428582046146m_-2609348240607948757gmail-hljs m_-3723783428582046146m_-2609348240607948757gmail-cpp">PEP-<span class="m_-3723783428582046146m_-2609348240607948757gmail-hljs-number">0511</span></code> should be improved, I can work on that.<br><br>3)</span></span><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_MTextBody m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_content"><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_body" dir="auto">Also I was seeing to existing repos which implement some-kind of optimizaton, like </span></span><br><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_MTextBody m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_content"><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_body m_-3723783428582046146m_-2609348240607948757gmail-markdown-body" dir="auto"><code class="m_-3723783428582046146m_-2609348240607948757gmail-hljs">numpy</code>,<code class="m_-3723783428582046146m_-2609348240607948757gmail-hljs">snake-oil</code>....<br><br></span></span></div><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_MTextBody m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_content"><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_body m_-3723783428582046146m_-2609348240607948757gmail-markdown-body" dir="auto">Finally I wanted to decide upon a roadmap, so that I could put more specific efforts.(fat optimizer?)<br></span></span></div><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_MTextBody m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_content"><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_body m_-3723783428582046146m_-2609348240607948757gmail-markdown-body" dir="auto"><br></span></span></div><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_MTextBody m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_content"><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_body m_-3723783428582046146m_-2609348240607948757gmail-markdown-body" dir="auto">Thank You<br></span></span></div><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_MTextBody m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_content"><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_body m_-3723783428582046146m_-2609348240607948757gmail-markdown-body" dir="auto">Regards,<br></span></span></div><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_MTextBody m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_content"><span class="m_-3723783428582046146m_-2609348240607948757gmail-mx_EventTile_body m_-3723783428582046146m_-2609348240607948757gmail-markdown-body" dir="auto">Bhavishya<br></span></span></div><div class="m_-3723783428582046146HOEnZb"><div class="m_-3723783428582046146h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 21, 2017 at 8:05 PM, Victor Stinner <span dir="ltr"><<a href="mailto:victor.stinner@gmail.com" target="_blank">victor.stinner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>2017-06-21 15:21 GMT+02:00 INADA Naoki <<a href="mailto:songofacandy@gmail.com" target="_blank">songofacandy@gmail.com</a>>:<br>
> ABC slowdown Python startup only 2ms.  But importing typing module take 11ms.<br>
> While typing is not imported from site.py, many new Python application<br>
> will import it.<br>
> It may take over 100ms for applications or libraries heavily depending on ABCs.<br>
<br>
</span>When typing is not used in the application, only used for static<br>
checks, you can try to "strip" annotations to avoid any overhead on<br>
the application startup. It's not only a matter of "import typing",<br>
it's also the cost of instanciating types like "List[int]" (or even<br>
more complex ones).<br>
<br>
I discussed with Jukka Lehtosalo at Pycon US about stripping<br>
completely annotations. He told me that my PEP 511 may be a good<br>
solution to keep annotation in the .py code, but strip them for<br>
"production code", in the cached .pyc files:<br>
<br>
"PEP 511 -- API for code transformers"<br>
<a href="https://www.python.org/dev/peps/pep-0511/" rel="noreferrer" target="_blank">https://www.python.org/dev/peps/pep-0511/</a><br>
<br>
This PEP is somehow controversal. Some people fear that it would allow<br>
people to hack the Python language to write their own incompatible<br>
variant of Python. I don't think that my PEP adds anything new, it's<br>
already possible to do that, importlib made it even more easy. I used<br>
my FAT Python optimizer project to sell this PEP. Since FAT Python is<br>
also controversal (it hasn't been proved to be actually faster), the<br>
PEP didn't go far at my last attempt.<br>
<br>
Note: Is core-menthorship the best place for such performance<br>
discussion? :-) Maybe we should open a thread on python-dev@ or speed@<br>
mailing list.<br>
<span class="m_-3723783428582046146m_-2609348240607948757HOEnZb"><font color="#888888"><br>
Victor<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/brett%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/brett%40python.org</a><br>
</blockquote></div></div>