belugabehr commented on a change in pull request #1301:
URL: https://github.com/apache/avro/pull/1301#discussion_r702476115
##########
File path: lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
##########
@@ -69,6 +69,16 @@
private static final GenericData INSTANCE = new GenericData();
+ private static final Map<Class<?>, String> PRIMATIVE_DATUM_TYPES = new
IdentityHashMap<>();
Review comment:
It's faster to use `IdentityHashMap` as it uses the primitive `==`
method instead of `equals`. When coming up with this solution, I did some
research and from everything I can find, it seems that as long as the classes
comes from the same class loader (as is the case here since it's populated by
the class itself and not an outside reference), then this should be perfectly
acceptable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]