A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2017-September/149168.html below:

[Python-Dev] To reduce Python "application" startup time

[Python-Dev] To reduce Python "application" startup time [Python-Dev] To reduce Python "application" startup timeNathaniel Smith njs at pobox.com
Tue Sep 5 16:11:50 EDT 2017
On Tue, Sep 5, 2017 at 11:13 AM, Jelle Zijlstra
<jelle.zijlstra at gmail.com> wrote:
>
>
> 2017-09-05 6:02 GMT-07:00 INADA Naoki <songofacandy at gmail.com>:
>> With this profile, I tried optimize `python -c 'import asyncio'`, logging
>> and http.client.
>>
>>
>> https://gist.github.com/methane/1ab97181e74a33592314c7619bf34233#file-0-optimize-import-patch
>>
> This patch moves a few imports inside functions. I wonder whether that kind
> of change actually helps with real applications—doesn't any real application
> end up importing the socket module anyway at some point?

I don't know if this particular change is worthwhile, but one place
where startup slowness is particularly noticed is with commands like
'foo.py --help' or 'foo.py --generate-completions' (the latter called
implicitly by hitting <tab> in some shell), which typically do lots of
imports that end up not being used.

-n

-- 
Nathaniel J. Smith -- https://vorpus.org
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4