PERF: speed up multi-key groupby