Author inada.naoki
Recipients inada.naoki, levkivskyi, 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:10inada.naokisetrecipients: + inada.naoki, yselivanov, levkivskyi
2018-01-19 10:54:10inada.naokisetmessageid: <1516359250.47.0.467229070634.issue32596@psf.upfronthosting.co.za>
2018-01-19 10:54:10inada.naokilinkissue32596 messages
2018-01-19 10:54:09inada.naokicreate