Message242089
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 |
|
| Date |
User |
Action |
Args |
| 2015-04-27 00:44:08 | llllllllll | set | recipients:
+ llllllllll, barry, rhettinger, eric.smith, eric.snow |
| 2015-04-27 00:44:08 | llllllllll | set | messageid: <[email protected]> |
| 2015-04-27 00:44:08 | llllllllll | link | issue23910 messages |
| 2015-04-27 00:44:07 | llllllllll | create | |
|