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-October/149683.html below:

[Python-Dev] Python startup optimization: script vs. service

[Python-Dev] Python startup optimization: script vs. service [Python-Dev] Python startup optimization: script vs. serviceSerhiy Storchaka storchaka at gmail.com
Mon Oct 2 11:38:42 EDT 2017
02.10.17 16:26, Victor Stinner пише:
> While "import module" is fast, maybe we should use sometimes a global
> variable to cache the import.
> 
> module = None
> def func():
>     global module
>     if module is None: import module
>     ...

I optimized "import module", and I think it can be optimized even more, 
up to making the above trick unnecessary. Currently there is an overhead 
of checking that the module found in sys.modules is not imported right now.

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