[issue9915] speeding up sorting with a key

Raymond Hettinger report at bugs.python.org
Tue Nov 23 02:16:40 CET 2010


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

Thanks for the revisions and timing updates.  I'm heartened that the common-case of sorting without a key function isn't negatively impacted.  That result is surprising though -- I thought the concept was manipulate the key and value arrays at the same time instead of just the keys -- did you do more than this, perhaps changing the logic or pattern of comparisons?  If so, I would be *much* more comfortable if Tim reviewed this.

The one part of the current code that would be missed is that it cleanly separates/decouples the key-function logic from the Timsort logic.  Now those are heavily intertwined -- I find the code harder to follow.

Why did the variable names change, pa/pb to ssa/ssb, etc.?

I'm hoping that I'll have a chance to go through the details of the patch in the next couple of weeks.  Unfortunately, the patch is huge and it looks like it mixes in a number of optimizations beyond just moving keys and values in parallel, variable names are changing, comment lines are rewrapped, etc.

----------

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


More information about the Python-bugs-list mailing list