This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients josh.r, rhettinger, serhiy.storchaka, wbolster
Date 2015-02-23.10:44:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1424688251.31.0.903385492971.issue23493@psf.upfronthosting.co.za>
In-reply-to
Content
CPython:

$ python3.4 -m timeit -s 'f = lambda kv: kv[0]' -s 's = list(dict.fromkeys(range(1000)).items())' -- 'sorted(s, key=f)'
1000 loops, best of 3: 904 usec per loop
$ python3.4 -m timeit -s 'import operator' -s 'f = operator.itemgetter(0)' -s 's = list(dict.fromkeys(range(1000)).items())' -- 'sorted(s, key=f)'
1000 loops, best of 3: 462 usec per loop

PyPy:

$ pypy -m timeit -s 'f = lambda kv: kv[0]' -s 's = list(dict.fromkeys(range(1000)).items())' -- 'sorted(s, key=f)'
1000 loops, best of 3: 1.23 msec per loop
$ pypy -m timeit -s 'import operator' -s 'f = operator.itemgetter(0)' -s 's = list(dict.fromkeys(range(1000)).items())' -- 'sorted(s, key=f)'
1000 loops, best of 3: 1.27 msec per loop
History
Date User Action Args
2015-02-23 10:44:11serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, wbolster, josh.r
2015-02-23 10:44:11serhiy.storchakasetmessageid: <1424688251.31.0.903385492971.issue23493@psf.upfronthosting.co.za>
2015-02-23 10:44:11serhiy.storchakalinkissue23493 messages
2015-02-23 10:44:11serhiy.storchakacreate