[ https://issues.apache.org/jira/browse/AVRO-3048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17414279#comment-17414279 ]
Erik Krogen commented on AVRO-3048: ----------------------------------- Hi [~rskraba], [~unchuckable] -- was backporting this performance fix ever discussed on the dev list? I was unable to find it in the archives ([you can find the search query I used here|https://lists.apache.org/list.html?*@avro.apache.org:lte=1y:AVRO-3048]). We've been encountering this issue on Avro 1.10.2 and would love to be able to benefit from the enhancement without having to wait for the Avro 1.11 release. > Using builders leads to performance degradation > ----------------------------------------------- > > Key: AVRO-3048 > URL: https://issues.apache.org/jira/browse/AVRO-3048 > Project: Apache Avro > Issue Type: Bug > Components: java > Affects Versions: 1.9.2, 1.10.1 > Reporter: Peter > Assignee: Martin Jubelgas > Priority: Major > Fix For: 1.11.0 > > > When you do a .newBuilder() for avro generated classes, this will call > org.apache.avro.specific.SpecificData.getForSchema: > > public static SpecificData getForSchema(Schema reader) { > if (reader.getType() == Type.RECORD) { > final String className = getClassName(reader); > if (className != null) { > final Class<?> clazz; > try > { > clazz = Class.forName(className); > return getForClass(clazz); } > catch (ClassNotFoundException e) > { return SpecificData.get(); > } > } > } > > which seems then to seldom find the value inside the try and a lot of > ClassNotFoundException is thrown. > Throwing internal exceptions has great performance penalties and in practice > users of avro 1.9.x. and 1.10.x in high performance applications are forced > not to use builders. > > Information about same problem is also found on: > [https://forums.databricks.com/questions/50803/orgapacheavrospecificspecificdatagetforschema-sear.html] > Problem exists on at least 1.9.2 and 1.10.1 (but not on 1.7.x) in OSGI > environment -- This message was sent by Atlassian Jira (v8.3.4#803005)