Author inada.naoki
Recipients inada.naoki
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:24inada.naokisetrecipients: + inada.naoki
2016-11-08 04:07:24inada.naokisetmessageid: <1478578044.23.0.961493371476.issue28638@psf.upfronthosting.co.za>
2016-11-08 04:07:24inada.naokilinkissue28638 messages
2016-11-08 04:07:23inada.naokicreate