Message236439
My interpretation of the results. In CPython using operator.itemgetter() makes sorting up to 2 times faster (only 25% faster with string keys), in PyPy it make sorting slightly slower (because operator.itemgetter() is implemented in Python, but the lambda is more specialized and could be better optimized).
The lambda looks more clear to me, and I think there is the possibility to optimize CPython to replace the body of such functions with builtins from the operator module. |
|
Date |
User |
Action |
Args |
2015-02-23 11:26:40 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, vstinner, wbolster, josh.r |
2015-02-23 11:26:40 | serhiy.storchaka | set | messageid: <1424690800.7.0.0510580666562.issue23493@psf.upfronthosting.co.za> |
2015-02-23 11:26:40 | serhiy.storchaka | link | issue23493 messages |
2015-02-23 11:26:40 | serhiy.storchaka | create | |
|