Reduce number of calls to mapper when sorting