opwvhk commented on PR #1624:
URL: https://github.com/apache/avro/pull/1624#issuecomment-1870133112

   > This one change causes a very serious performance degradation in Avro 
1.11.2. ServiceLoader load is a slow and synchronized operation and should not 
be done in the constructor of a frequently used object, or without some form of 
caching.
   
   I'm sorry to hear this. Where do you believe a cache could help?
   
   As I understand from the source code, the `ServiceLoader` implementation in 
OpenJDK caches its results since version 1.8, and `GenericData` stores/caches 
the results in the model immediately upon creation.
   
   Note that I expect the model itself to be a long-lived object: `GenericData` 
and all subclasses in (not limited to `SpecificData` & `ReflectData`) cache an 
instance, and the Avro compiler for Java generates cached versions in each 
class as well. Is your use case different?


-- 
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]

Reply via email to