Author llllllllll
Recipients barry, eric.smith, eric.snow, llllllllll, rhettinger
Date 2015-04-27.00:44:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430095448.12.0.181223845579.issue23910@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2015-04-27 00:44:08llllllllllsetrecipients: + llllllllll, barry, rhettinger, eric.smith, eric.snow
2015-04-27 00:44:08llllllllllsetmessageid: <1430095448.12.0.181223845579.issue23910@psf.upfronthosting.co.za>
2015-04-27 00:44:08lllllllllllinkissue23910 messages
2015-04-27 00:44:07llllllllllcreate