summarizer: adding support for pre_sorted groups as a memory and speed optimization.