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

Thiruvalluvan M. G. edited comment on AVRO-753 at 2/10/11 1:44 AM:
-------------------------------------------------------------------

We just write (positive) 1 for item-count and no byte-count (line 602 in 
BlockedBinaryEncoder.java) for overflow blocks. Since the reader is not 
supposed to expect byte-count when it encounters a positive item-count, it 
works.

      was (Author: thiru_mg):
    We just write 1 (line 602 in BlockedBinaryEncoder) for overflow blocks. We 
use positive 1 to indicate that we have a single item in the block and 
byte-count is unknown. 
  
> Java:  Improve BinaryEncoder Performance
> ----------------------------------------
>
>                 Key: AVRO-753
>                 URL: https://issues.apache.org/jira/browse/AVRO-753
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Scott Carey
>            Assignee: Scott Carey
>             Fix For: 1.5.0
>
>         Attachments: AVRO-753.v1.patch
>
>
> BinaryEncoder has not had a performance improvement pass like BinaryDecoder 
> did.  It still mostly writes directly to the underlying OutputStream which is 
> not optimal for performance.  I like to use a rule that if you are writing to 
> an OutputStream or reading from an InputStream in chunks smaller than 128 
> bytes, you have a performance problem.
> Measurements indicate that optimizing BinaryEncoder yields a 2.5x to 6x 
> performance improvement.  The process is significantly simpler than 
> BinaryDecoder because 'pushing' is easier than 'pulling' -- and also because 
> we do not need a 'direct' variant because BinaryEncoder already buffers 
> sometimes.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to