Message280277
I surprised how functools make import time slower.
And I find namedtuple makes it slower.
When I replaced
_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])
this line with `_CachedInfo._source`:
(before)
$ ~/local/py37/bin/python3 -m perf timeit -s 'import importlib, functools' -- 'importlib.reload(functools)'
.....................
Median +- std dev: 1.21 ms +- 0.01 ms
(replaced)
$ ~/local/py37/bin/python3 -m perf timeit -s 'import importlib, functools' -- 'importlib.reload(functools)'
.....................
Median +- std dev: 615 us +- 12 us |
|
| Date |
User |
Action |
Args |
| 2016-11-08 04:07:24 | methane | set | recipients:
+ methane |
| 2016-11-08 04:07:24 | methane | set | messageid: <[email protected]> |
| 2016-11-08 04:07:24 | methane | link | issue28638 messages |
| 2016-11-08 04:07:23 | methane | create | |
|