[ https://issues.apache.org/jira/browse/AVRO-1277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13609175#comment-13609175 ]
Leo Romanoff commented on AVRO-1277: ------------------------------------ I attach a first version of my patch. It is just to explain the idea. Formatting and other issues can be solved later. What this patch does: - It caches using thread-local cache classes that were looked up before - It caches using thread-local cache fields of classes that were determined before using reflection - It provides a more efficient way to work with arrays of primitive types, because working with arrays using reflection is quite slow - It adds support for Character fields in Java classes, because it was not supported for some reason. It has nothing to do with reflection ;-) I just needed it and added support in a way similar to how "short" class is handled. This change touches the same classes that reflection changes though. If you don't like it or want it to be a separate patch, I could submit it separately later -Leo > Improve performance of reflection-based serializers > --------------------------------------------------- > > Key: AVRO-1277 > URL: https://issues.apache.org/jira/browse/AVRO-1277 > Project: Avro > Issue Type: Improvement > Components: java > Affects Versions: 1.7.4 > Reporter: Leo Romanoff > Priority: Minor > > I've played a bit with Avro serialization based on reflection, i.e. with the > classes from org.apache.avro.generic package. > It works fine in this mode, but is rather slow compared to such frameworks > like protostuff or kryo. > Quick look at the source code has shown that a lot of reflection-based > operations and class lookups are not cached. And such operations are usually > pretty expensive when executed by a JVM. > So I changed some of org.apache.avro.generic classes, introduced caching and > a few other optimizations. Now it seems to perform much better. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira