[ https://issues.apache.org/jira/browse/SPARK-14277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15218939#comment-15218939 ]
Apache Spark commented on SPARK-14277: -------------------------------------- User 'sitalkedia' has created a pull request for this issue: https://github.com/apache/spark/pull/12074 > UnsafeSorterSpillReader should do buffered read from underlying compression > stream > ---------------------------------------------------------------------------------- > > Key: SPARK-14277 > URL: https://issues.apache.org/jira/browse/SPARK-14277 > Project: Spark > Issue Type: Improvement > Components: Shuffle > Affects Versions: 1.6.1 > Reporter: Sital Kedia > > While running a Spark job which is spilling a lot of data in reduce phase, we > see that significant amount of CPU is being consumed in native Snappy > ArrayCopy method (Please see the stack trace below). > Stack trace - > org.xerial.snappy.SnappyNative.$$YJP$$arrayCopy(Native Method) > org.xerial.snappy.SnappyNative.arrayCopy(SnappyNative.java) > org.xerial.snappy.Snappy.arrayCopy(Snappy.java:85) > org.xerial.snappy.SnappyInputStream.rawRead(SnappyInputStream.java:190) > org.xerial.snappy.SnappyInputStream.read(SnappyInputStream.java:163) > java.io.DataInputStream.readFully(DataInputStream.java:195) > java.io.DataInputStream.readLong(DataInputStream.java:416) > org.apache.spark.util.collection.unsafe.sort.UnsafeSorterSpillReader.loadNext(UnsafeSorterSpillReader.java:71) > org.apache.spark.util.collection.unsafe.sort.UnsafeSorterSpillMerger$2.loadNext(UnsafeSorterSpillMerger.java:79) > org.apache.spark.sql.execution.UnsafeExternalRowSorter$1.next(UnsafeExternalRowSorter.java:136) > org.apache.spark.sql.execution.UnsafeExternalRowSorter$1.next(UnsafeExternalRowSorter.java:123) > The reason for that is the SpillReader does a lot of small reads from the > underlying snappy compressed stream and we pay a heavy cost of jni calls for > these small reads. The SpillReader should instead do a buffered read from the > underlying snappy compressed stream. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org