INADA Naoki added the comment: > What is the main culprit, importing the collections module or compiling a > named tuple?
In this time, later. But collections module takes 1+ ms to import too. I'll try to optimize it. > Using namedtuple is not new in 3.6, thus this is not a regression that can be > fixed at beta stage. Make sense. > More general solution would be to make namedtuple() using cached precompiled > class and update the cache if it doesn't match namedtuple arguments. What "precompiled class" means? pyc file? or source string to be executed? > Yet one solution is to make namedtuple() not using compiling, but return > patched local class. But Raymond is against this. I'll search the discussion. I think anther solution is reimplement namedtuple by C. As far as I remember, attrs [1] does it. [1] https://pypi.python.org/pypi/attrs ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28638> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com