This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:24methanesetrecipients: + methane
2016-11-08 04:07:24methanesetmessageid: <1478578044.23.0.961493371476.issue28638@psf.upfronthosting.co.za>
2016-11-08 04:07:24methanelinkissue28638 messages
2016-11-08 04:07:23methanecreate