[
https://issues.apache.org/jira/browse/AVRO-557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874916#action_12874916
]
Scott Carey commented on AVRO-557:
----------------------------------
bq. But... Given what you said, shouldn't
GenericReaderOneTimeUsageDirectDecoderNoResolverTest have the same performance
as GenericReaderOneTimeUsage12Test? Mind you, I'm happy with this improvement,
just trying to see what the difference is.
The test above is not using a DirectBinaryDecoder, but a buffered one with a
buffer size of 256 bytes. To test the DirectBinaryDecoder you would have to
call configureDirectDecoder(true) on the factory.
So the above is the new binary decoder (which avoids the slow InputStream API
as much as possible, preferring array access), but with a tiny buffer so that
lots of allocations won't hurt.
However the above test is creating the decoder on a byte[], which avoids then
InputStream entirely. If your use case wraps around an InputStream it will be
slower than the above because it will create that 256 byte buffer each time.
> 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.