commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Digulla (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-286) FastByteArray*Stream implementations to replace syncronized JDK ByteArray*Stream
Date Mon, 26 Mar 2012 09:53:26 GMT

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

Aaron Digulla commented on IO-286:
----------------------------------

Comments:

# Always use spaces for indentation
# Allow to override the allocation strategy. If the buffer grows fast, a different strategy
could allocate bigger chunks in the beginning (= less overall allocations) and be more conservative
later (so after the buffer has grown to 10MB, maybe 15MB is better than 20MB for the next
round). To implement this, export the code to calculate {{newBufferSize}} into a protected
method.
# I'm also confused by {{writeBytes()}} but more about the loop inside: Why do you need a
loop there? You already know how many bytes to append and how much buffer you have left -
why not extend the buffer as necessary and then append all the new bytes in one go?
                
> 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, FastByteArrayOutputStream_commons-io[2].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

        

Mime
View raw message