David Di Biase wrote:
Using key is faster than cmp because key is called just once for each
item whereas cmp is called once for each of the O(nlogn) compares.
Operator.itemge tter is written in C and hence should be faster than a
wrapper written in Python.
When you say slightly, is it enough to make a difference? Why would
getitems be faster even - not sure I can think why...
>
getitems be faster even - not sure I can think why...
>
item whereas cmp is called once for each of the O(nlogn) compares.
Operator.itemge tter is written in C and hence should be faster than a
wrapper written in Python.