This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients levkivskyi, methane, yselivanov
Date 2018-01-19.10:54:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516359250.47.0.467229070634.issue32596@psf.upfronthosting.co.za>
In-reply-to
Content
Since PEP 562 is implemented, we can use lazy imports easily.

Asyncio uses concurrent.futures.Future and concurrent.futures.ThreadPoolExecutor,
but not concurrent.futures.ProcessPoolExecutor by default.

Since importing concurrent.futures.process is slow, I want to import it lazily.
And it make sense to import concurrent.futures.thread too, because it's very
easy when we start to use __getattr__ once.

Here is quick benchmark:


$ ./python -m perf command ./python -c 'import asyncio'  # patched
.....................
command: Mean +- std dev: 60.5 ms +- 0.1 ms
$ git stash
$ ./python -m perf command ./python -c 'import asyncio'  # original
.....................
command: Mean +- std dev: 74.3 ms +- 0.2 ms
History
Date User Action Args
2018-01-19 10:54:10methanesetrecipients: + methane, yselivanov, levkivskyi
2018-01-19 10:54:10methanesetmessageid: <1516359250.47.0.467229070634.issue32596@psf.upfronthosting.co.za>
2018-01-19 10:54:10methanelinkissue32596 messages
2018-01-19 10:54:09methanecreate