[issue23493] optimize sort_keys in json module by using operator.itemgetter()

STINNER Victor report at bugs.python.org
Mon Feb 23 12:15:16 CET 2015


STINNER Victor added the comment:

> That said, it is applied only n-times and is likely insignificant when compared to the O(n log n) sort. (...)

904 usec => 462 usec is very significant: it's 49% faster. So I'm ok for the change.

Note: PyPy JIT may not be able to optimize operator.itemgetter, whereas it optimizes the simple lambda function. You may report this performance issue to PyPy. PyPy may use different code in json for best performances.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23493>
_______________________________________


More information about the Python-bugs-list mailing list