Github user sameeragarwal commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13318#discussion_r65628155
  
    --- 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 --
    
    can we also update the comments above while instantiating `array` to better 
indicate the contents of the array (and talk about the additional buffer that's 
needed for sorting)


---
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]

Reply via email to