Python — Efficiency of sorting by multiple keys

Two simpler sorts can be faster than one more complex sort

Here are benchmarks with a few more versions:

At elements, still beats :

0.023 seconds  multisort                 (no previous result)
0.032 seconds multisort_tupled (same as previous result)
0.027 seconds multisort_tupled_gc_off (same as previous result)
0.015 seconds multisort_inplaced (same as previous result)
0.020 seconds multikey