Right, the map->array of entries->sort. Allocating one chunk (especially when you know how big it needs to be) will be better than allocating many smaller chunks. The sort won't do any cloning.