[issue23910] C implementation of namedtuple (WIP)

Joe Jevnik report at bugs.python.org
Mon Apr 27 02:44:08 CEST 2015


Joe Jevnik added the comment:

I was unable to see a performance increase by playing with the itemgetter.__call__ code; however, updating the propery code seemed to show a small improvement. I think that for simple indexing the cost of checking if it is a sequence outways the faster dispatch (when using PySequence_GetItem). I can play with this further.

* default
[joejev at Sheila cpython]$ ./python -m timeit -s "from collections import namedtuple as n;a = n('n', 'a b c')(1, 2, 3)" "a.a"
10000000 loops, best of 3: 0.101 usec per loop

* patch
[joejev at Sheila cpython]$ ./python -m timeit -s "from collections import namedtuple as n;a = n('n', 'a b c')(1, 2, 3)" "a.a"
10000000 loops, best of 3: 0.0942 usec per loop

----------
Added file: http://bugs.python.org/file39210/property.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23910>
_______________________________________


More information about the Python-bugs-list mailing list