[
https://issues.apache.org/jira/browse/AVRO-2090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16633570#comment-16633570
]
ASF GitHub Bot commented on AVRO-2090:
--------------------------------------
rstata commented on a change in pull request #256: AVRO-2090: Improve
encode/decode time for SpecificRecord using code generation
URL: https://github.com/apache/avro/pull/256#discussion_r221484459
##########
File path:
lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java
##########
@@ -122,6 +122,10 @@ public DatumWriter createDatumWriter(Schema schema) {
/** Return the singleton instance. */
public static SpecificData get() { return INSTANCE; }
+ private static final boolean USE_CUSTOM_CODERS
+ =
Boolean.parseBoolean(System.getProperty("org.apache.avro.specific.use_custom_coders","false"));
+ public boolean useCustomCoders() { return USE_CUSTOM_CODERS; }
Review comment:
In
https://github.com/rstata-projects/avro/commit/e81a5880be69aef5bffdcf38f7ae3491957a6a68,
I changed this flag to be dynamically changable.
For the record, here's the roll-out plan I imagined for this feature (See
[AVRO-2091](https://issues.apache.org/jira/browse/AVRO-2091)). The initial
release of this feature sets the `use_custom_coders` flag to `false` by
default, to allow for some road testing. The release after that would set
this flag to `true` by default, to allow for some more serious road testing.
The next release of Avro after that would then eliminate this flag altogether,
under the assumption that the feature has been sufficiently tested and there's
no longer a use for the old way of doing things.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Improve encode/decode time for SpecificRecord using code generation
> -------------------------------------------------------------------
>
> Key: AVRO-2090
> URL: https://issues.apache.org/jira/browse/AVRO-2090
> Project: Avro
> Issue Type: Improvement
> Components: java
> Reporter: Raymie Stata
> Assignee: Raymie Stata
> Priority: Major
> Attachments: customcoders.md
>
>
> Compared to GenericRecords, SpecificRecords offer type-safety plus the
> performance of traditional getters/setters/instance variables. But these are
> only beneficial to Java code accessing those records. SpecificRecords
> inherit serialization and deserialization code from GenericRecords, which is
> dynamic and thus slow (in fact, benchmarks show that serialization and
> deserialization is _slower_ for SpecificRecord than for GenericRecord).
> This patch extends record.vm to generate custom, higher-performance encoder
> and decoder functions for SpecificRecords. We've run a public benchmark
> showing that the new code reduces serialization time by 2/3 and
> deserialization time by close to 50%.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)