[ 
https://issues.apache.org/jira/browse/AVRO-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800112#action_12800112
 ] 

Doug Cutting commented on AVRO-315:
-----------------------------------

Scott: This is great stuff!

I note that doReadBytes(), once the buffer is exhausted, never calls 
in.read(bytes, start, length).  Shouldn't we bypass the buffer in this case?

This changes semantics a bit, since currently BinaryDecoder does not buffer.  
For example, in DataFileReader seeks the underlying stream.  So, in that case, 
we'll need to be able to reset the Decoder's buffer after a seek.  There could 
also be places where an application reads alternately from the Decoder and its 
underlying InputStream, although, at a glance, I can't find any such in the 
code currently.


> Performance improvements to BinaryDecoder
> -----------------------------------------
>
>                 Key: AVRO-315
>                 URL: https://issues.apache.org/jira/browse/AVRO-315
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Thiruvalluvan M. G.
>            Assignee: Thiruvalluvan M. G.
>         Attachments: AVRO-315-prototype.patch, AVRO-315-test.patch, 
> AVRO-315.patch, AVRO-315.patch
>
>
> The forthcoming patch improves the performance of BinaryDecoder.readLong(), 
> readFloat() and readDouble().
> The test-patch has a command-line program Perf in org.apache.avro.io in the 
> (test part of the source directory) which tests the performance of readInt() 
> (which calls readLong())  readFloat() and readDouble(). On my machine, the 
> patch improves the performance by 10% for readInt() and about 50% for 
> readFloat() and readDouble().
> The idea is to unroll the loops in readLong(), readFloat() and readDouble(). 
> There is a small change in doReadBytes() which checks for most common 
> condition before less common ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to