➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 llllllllll
收信人 barry, eric.smith, eric.snow, llllllllll, rhettinger
日期 2015-04-27.00:44:06
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1430095448.12.0.181223845579.issue23910@psf.upfronthosting.co.za>
In-reply-to
内容
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
历史
日期 用户 动作 参数
2015-04-27 00:44:08llllllllll修改recipients: + llllllllll, barry, rhettinger, eric.smith, eric.snow
2015-04-27 00:44:08llllllllll修改messageid: <1430095448.12.0.181223845579.issue23910@psf.upfronthosting.co.za>
2015-04-27 00:44:08llllllllll链接issue23910 messages
2015-04-27 00:44:07llllllllll创建