A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-September/149188.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 timeINADA Naoki songofacandy at gmail.com
Wed Sep 6 00:20:34 EDT 2017
>> 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?
>

Ah, I'm sorry.  It doesn't importing asyncio, logging and http.client faster.

I saw pkg_resources.  While it's not stdlib, it is imported very often.
And it uses email.parser, but doesn't require socket or random.

Since socket module creates some enums, removing it reduces few milliseconds.

Regards,
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