Github user sameeragarwal commented on a diff in the pull request:
https://github.com/apache/spark/pull/13318#discussion_r65629505
--- Diff:
core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java ---
@@ -70,9 +70,14 @@ public int compare(PackedRecordPointer left,
PackedRecordPointer right) {
assert (initialSize > 0);
this.initialSize = initialSize;
this.useRadixSort = useRadixSort;
- this.memoryAllocationFactor = useRadixSort ? 2 : 1;
this.array = consumer.allocateArray(initialSize);
- this.sorter = new Sorter<>(ShuffleSortDataFormat.INSTANCE);
+ this.usableCapacity = calcCapacity();
+ }
+
+ private int calcCapacity() {
+ // Radix sort requires same amount of used memory as buffer, Tim sort
requires
+ // half of the used memory as buffer.
--- End diff --
by the way, out of curiosity, what's the worst case scenario in TimSort
that requires 0.5x more buffer space?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]