Giampaolo Rodola' added the comment:

> While "40x faster" is more 10x faster than "4x faster", C 
> implementation can boost only CPython and makes maintenance more harder.

As a counter argument against "let's not do it because it'll be harder to 
maintain" I'd like to point out that namedtuple API is already kind of over 
engineered (see: "verbose", "rename", "module" and "_source") and as such it 
seems likely it will remain pretty much the same in the future. So why not 
treat namedtuple like any other basic data structure, boost its internal 
implementation and simply use the existing unit tests to make sure there are no 
regressions? It seems the same barrier does not apply to tuples, lists and sets.

> Of course, 1.9x faster attribute access 
> (http://bugs.python.org/issue28638#msg298499) is attractive.

It is indeed and it makes a huge difference in situations like busy loops. E.g. 
in case of asyncio 1.9x faster literally means being able to serve twice the 
number of reqs/sec:
https://github.com/python/cpython/blob/3e2ad8ec61a322370a6fbdfb2209cf74546f5e08/Lib/asyncio/selector_events.py#L523

----------

_______________________________________
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

Reply via email to