Description
Optimizing the performance of sorting
Root cause: In case of sorting in the comparator classes(NewRowComparator, RawRowComparator, IntermediateSortTempRowComparator and UnsafeRowComparator) a new SerializableComparator object is been created in the compare method everytime two objects are passed for comparison.
Solution: We can reduce the number of SerializeableComparator objects that are been created by storing the SerializeableComparators of primitive datatypes in a map and getting it from the map instead of creating a new SerializeableComparator everytime.