You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Paul Loy (Commented) (JIRA)" <ji...@apache.org> on 2012/01/12 23:51:39 UTC

[jira] [Commented] (IO-286) FastByteArray*Stream implementations to replace syncronized JDK ByteArray*Stream

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

Paul Loy commented on IO-286:
-----------------------------

Comments on the patch:
* added FastByteArrayOutputStream (and corresponding unit test)
* added to javadoc of ByteArrayOutputStream to suggest the Fast version when thread safety is not an issue
* I decided not to make ByteArrayOutputStream extend FastByteArrayOutputStream - adding only the synchronization - as this would slow that implementation down by traversing the stack.

Also note I noticed that the patch I just uploaded is wrong. New one to follow in a few seconds.
                
> FastByteArray*Stream implementations to replace syncronized JDK ByteArray*Stream
> --------------------------------------------------------------------------------
>
>                 Key: IO-286
>                 URL: https://issues.apache.org/jira/browse/IO-286
>             Project: Commons IO
>          Issue Type: New Feature
>          Components: Streams/Writers
>            Reporter: Paul Loy
>            Priority: Minor
>              Labels: streams, synchronized
>         Attachments: FastByteArrayOutputStream_commons-io.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In CASSANDRA-2820 I reintoduced the FastByteArrayInputStream and FastByteArrayOutputStream to cassandra. These steams are un-synchronized versions of the Apache Harmony ByteArrayInputStream and ByteArrayOutputStream respectively.
> During my own testing of the streams I found a big difference in the performance of the standard JDK BA*S steams and the FBA*S streams on most JREs. Then cassandra load testing also showed an up to 10% improvement in cassandra performance using these streams.
> Then Thrift has TByteArrayOutputStream which contains a way to get the underlying byte[] buffer without a deep copy that would probably be a good further enhancement.
> Patch to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira