[Python-ideas] [Python-Dev] Optimizing list.sort() by checking type in advance

Elliot Gorokhovsky elliot.gorokhovsky at gmail.com
Tue Oct 11 00:22:04 EDT 2016


On Mon, Oct 10, 2016 at 10:15 PM Guido van Rossum <guido at python.org> wrote:


> But that's suspicious in itself -- since no comparisons are needed to
>
> sort a 1-element list, if it's still faster, there must be something
>
> else you're doing (or not doing) that's affecting the time measured.
>

Oh, ya. Duh. So that's weird... I would very much to figure out what causes
that, actually. I don't think method calling has anything to do with it,
since I'm subclassing list (could be wrong though). Perhaps it has to do
with the fact that my sort method is compiled on my laptop while my python
is a distributed binary? I will be able to rule that out when I implement
this as a patch instead of an extension module and test my own build.

Anyway, thanks for looking at all this, I will post on the bug tracker and
on here once I have something more mature; this feedback has been very
useful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161011/790f599a/attachment.html>


More information about the Python-ideas mailing list