Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/5868#issuecomment-99190417
  
    I just pushed a somewhat messy work-in-progress version of a 
shuffle-specific sort that implements the optimizations described in [my 
earlier 
comment](https://github.com/apache/spark/pull/5868#issuecomment-98888713). 
There's still a lot of work to do, mostly writing additional unit tests, adding 
comments, cleaning up a bunch of TODOs, but this illustrates the basic idea.
    
    To provide a quick preview of the key parts of the code:
    
    - [Code for packing record pointers and partition ids into 
longs](https://github.com/JoshRosen/spark/blob/4f70141aa6949d9251719790551e184cac66a05b/core/src/main/java/org/apache/spark/shuffle/unsafe/PackedRecordPointer.java#L49)
 (and 
[test](https://github.com/JoshRosen/spark/blob/4f70141aa6949d9251719790551e184cac66a05b/core/src/test/java/org/apache/spark/shuffle/unsafe/PackedRecordPointerSuite.java))
    - [Code for sorting using packed record 
pointers](https://github.com/JoshRosen/spark/blob/4f70141aa6949d9251719790551e184cac66a05b/core/src/main/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleSorter.java)
    - [(Somewhat messy) code for adding spilling to the 
sort](https://github.com/JoshRosen/spark/blob/4f70141aa6949d9251719790551e184cac66a05b/core/src/main/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleSpillWriter.java)
    - [Code for efficient merging of spilled files (without performing 
deserialization)](https://github.com/JoshRosen/spark/blob/unsafe-sort/core/src/main/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriter.java#L156)
    
    I'm going to be working on documenting and cleaning up this code during the 
afternoon, so I'd hold off on trivial comments on code style, import ordering, 
etc as I'll take care of that during the cleanup pass.
    
    There are also some implications for the maximum record size / maximum 
amount of memory that can be used per task; I'll walk through the calculations 
for this and post a writeup soon.


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