On Sat, Mar 12, 2011 at 4:58 PM, Nick Coghlan <[email protected]> wrote: > On Sat, Mar 12, 2011 at 4:50 PM, Reid Kleckner <[email protected]> > wrote: >> They should be able to use a slotted cmp_to_key style class: >> http://docs.python.org/howto/sorting.html >> >> That will allocate 1 Python object with no dict per key, but that >> might not be good enough. > > Tuples are already slotted, so that isn't likely to help in this case.
It's three allocations vs. one. The first is tuple + str + int, while the adapter is just one object. I'm not sure how it eventually shakes out, though. That said, it's still worse than Python 2, which is zero allocations. :) Reid _______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
