[ 
https://issues.apache.org/jira/browse/SPARK-23347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16354962#comment-16354962
 ] 

Sean Owen commented on SPARK-23347:
-----------------------------------

Well, that would depend on what Jackson does, and that's buried pretty deep, 
but I'd guess it's the smart thing. The efficiency of serializing 4 bytes just 
can't vary that much though.

As I say, GZipOutputStream is already buffered; why would an extra buffer help?

> Introduce buffer between Java data stream and gzip stream
> ---------------------------------------------------------
>
>                 Key: SPARK-23347
>                 URL: https://issues.apache.org/jira/browse/SPARK-23347
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 2.2.0
>            Reporter: Ted Yu
>            Priority: Minor
>
> Currently GZIPOutputStream is used directly around ByteArrayOutputStream 
> e.g. from KVStoreSerializer :
> {code}
>       ByteArrayOutputStream bytes = new ByteArrayOutputStream();
>       GZIPOutputStream out = new GZIPOutputStream(bytes);
> {code}
> This seems inefficient.
> GZIPOutputStream does not implement the write(byte) method. It only provides 
> a write(byte[], offset, len) method, which calls the corresponding JNI zlib 
> function.
> BufferedOutputStream can be introduced wrapping GZIPOutputStream for better 
> performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to