Serhiy Storchaka added the comment:

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.

----------
priority: normal -> low
status: open -> languishing

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23493>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to