Message280277
| Author |
methane |
| Recipients |
methane |
| Date |
2016年11月08日.04:07:23 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1478578044.23.0.961493371476.issue28638@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年11月08日 04:07:24 | methane | set | recipients:
+ methane |
| 2016年11月08日 04:07:24 | methane | set | messageid: <1478578044.23.0.961493371476.issue28638@psf.upfronthosting.co.za> |
| 2016年11月08日 04:07:24 | methane | link | issue28638 messages |
| 2016年11月08日 04:07:23 | methane | create |
|