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@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@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue23910>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to