3 ms·
That's a nice idea. Do you know of any programs that use this? I know that CPython treats hash tables with string keys as a special case, for performance. I
by chubot 8y ago
That's a nice idea. Do you know of any programs that use this?
I know that CPython treats hash tables with string keys as a special case, for performance. I wonder if it might also make sense to treat sorting lists of strings as a special case (or maybe it already does, I will check ...).
Hm yeah it looks like Python's timsort is meant to minimize the number of comparison operations (see Objects/listsort.txt). But it doesn't try to make the comparisons themselves cheaper. That would break the interface to some extent, i.e. it doesn't really fit within the model.
Interesting to think about though!