Message312781
The proposed PR optimizes "from ... import ..." from non-package modules.
$ ./python -m perf timeit 'from locale import getlocale'
Unpatched: Mean +- std dev: 811 ns +- 27 ns
Patched: Mean +- std dev: 624 ns +- 17 ns
Currently _bootstrap._handle_fromlist() is called which does nothing if the module is not a package, but adds an overhead of calling a Python function. The PR moves this check out of _handle_fromlist and avoid calling it if not needed. |
|
Date |
User |
Action |
Args |
2018-02-25 08:46:54 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, brett.cannon, ncoghlan, eric.snow |
2018-02-25 08:46:54 | serhiy.storchaka | set | messageid: <1519548414.92.0.467229070634.issue32946@psf.upfronthosting.co.za> |
2018-02-25 08:46:54 | serhiy.storchaka | link | issue32946 messages |
2018-02-25 08:46:54 | serhiy.storchaka | create | |
|