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

Scott Carey commented on AVRO-557:
----------------------------------

note that 
'new BinaryDecoder()'

is deprecated now as well.  The factory allows you to control the performance 
behavior better.

I suspect that if you changed the 1.3 'one time' test from:

{code}
  private static class GenericReaderOneTimeUsage13Test extends 
GenericReaderOneTimeUsageTest {
    protected GenericReaderOneTimeUsage13Test() throws IOException {
      super("GenericReaderOneTimeUsage13Test");
    }
    @Override protected DatumReader<Object> getReader() {
      return new GenericDatumReader<Object>(writerSchema);
    }
    @Override protected Decoder getDecoder() {
      return DecoderFactory.defaultFactory().createBinaryDecoder(data, null);
    }
  }
{code}
to
{code}
  static DecoderFactory factory = new DecoderFactory();
  static {
    factory.configureDecoderBufferSize(256);
  }
  private static class GenericReaderOneTimeUsage13Test extends 
GenericReaderOneTimeUsageTest {
    protected GenericReaderOneTimeUsage13Test() throws IOException {
      super("GenericReaderOneTimeUsage13Test");
    }
    @Override protected DatumReader<Object> getReader() {
      return new GenericDatumReader<Object>(writerSchema);
    }
    @Override protected Decoder getDecoder() {
      return factory.createBinaryDecoder(data, null);
    }
  }
{code}

That the performance would be much better.

> Speed up one-time data decoding
> -------------------------------
>
>                 Key: AVRO-557
>                 URL: https://issues.apache.org/jira/browse/AVRO-557
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.3.2
>            Reporter: Kevin Oliver
>            Assignee: Kevin Oliver
>             Fix For: 1.4.0
>
>         Attachments: AVRO-557.patch
>
>
> There are big gains to be had in performance when using a BinaryDecoder and a 
> GenericDatumReader just one time. This is due to the relatively expensive 
> parsing and initialization that came with 1.3. Patch with example code and a 
> Perf harness to follow.

-- 
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