[ https://issues.apache.org/jira/browse/CASSANDRA-2820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13085908#comment-13085908 ]
Hudson commented on CASSANDRA-2820: ----------------------------------- Integrated in Cassandra #1026 (See [https://builds.apache.org/job/Cassandra/1026/]) Re-introduce FastByteArrayInputStream (and Output equivalent) Patch by Paul Loy, reviewed by brandonwilliams for CASSANDRA-2820 brandonwilliams : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1158410 Files : * /cassandra/trunk/src/java/org/apache/cassandra/db/ReadVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/db/Truncation.java * /cassandra/trunk/src/java/org/apache/cassandra/db/TruncateResponse.java * /cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java * /cassandra/trunk/src/java/org/apache/cassandra/db/CounterMutationVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java * /cassandra/trunk/src/java/org/apache/cassandra/io/util/FastByteArrayOutputStream.java * /cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java * /cassandra/trunk/src/java/org/apache/cassandra/io/util/FastByteArrayInputStream.java * /cassandra/trunk/src/java/org/apache/cassandra/db/IndexScanCommand.java * /cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAck2VerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/db/TruncateVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java * /cassandra/trunk/src/java/org/apache/cassandra/db/WriteResponse.java * /cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamReplyVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/service/AbstractRowResolver.java * /cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamRequestMessage.java * /cassandra/trunk/src/java/org/apache/cassandra/io/util/OutputBuffer.java * /cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceCommand.java * /cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java * /cassandra/trunk/src/java/org/apache/cassandra/db/RangeSliceReply.java * /cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/service/MigrationManager.java * /cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestSynVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/db/ReadRepairVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAckVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java * /cassandra/trunk/src/java/org/apache/cassandra/db/CounterMutation.java * /cassandra/trunk/src/java/org/apache/cassandra/net/IncomingTcpConnection.java * /cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java * /cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamRequestVerbHandler.java * /cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamReply.java > Re-introduce FastByteArrayInputStream (and Output equivalent) > ------------------------------------------------------------- > > Key: CASSANDRA-2820 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2820 > Project: Cassandra > Issue Type: Improvement > Components: Core > Affects Versions: 0.8.0 > Environment: n/a > Reporter: Paul Loy > Assignee: Paul Loy > Priority: Minor > Labels: bytearrayinputstream, bytearrayoutputstream, license, > synchronized > Fix For: 1.0 > > Attachments: fast_bytearray_iostreams_harmony-patch-2.txt, > fast_bytearray_iostreams_harmony-patch-3.txt, > fast_bytearray_iostreams_harmony-patch-4.txt, > fast_bytearray_iostreams_harmony-patch-5.txt, > fast_bytearray_iostreams_harmony-patch-6.txt > > > In https://issues.apache.org/jira/browse/CASSANDRA-37 > FastByteArrayInputStream and FastByteArrayOutputStream were removed due to > being code copied from the JDK and then subsequently modified. The JDK > license is incompatible with Apache 2 license so the code had to go. > I have since had a look at the performance of the JDK ByteArrayInputStream > and a FastByteArrayInputStream (i.e. one with synchronized methods made > un-synchronized) and seen the difference is significant. > After a warmup-period of >10000 loops I get the following for 10000 loops > through a 128000 byte array: > bais : 3513ms > fbais: 72ms > This varies depending on the OS, machine and Java version, but it's always in > favour of the FastByteArrayInputStream as you might expect. > Then, at Jonathan Ellis' suggestion, I tried this using a modified Apache > Harmony ByteArrayInputStream - i.e. one whose license is compatible - and the > results were the same. A significant boost. > I will attach a patch with changes for the 0.8.0 tag. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira