Commits


Radai Rosenblatt authored and GitHub committed 89efb8dd7be
AVRO-3094: improve performance of SpecificData.getForClass(), especially around old generated specific record classes (#1172) Avro 1.9+ attempts to access static field MODEL$ on avo-generated classes. Record classes generated by older Avro (for example 1.7) do not have this field. This causes modern avro to catch an exception on every record being deserialized for such classes, which can cause a x3 slow down (see profiler results in the Jira ticket). This fix uses ClassValue to cache the SpecificData instance to use per class. This results in s ~x5 speedup for the happy path (classes that have MODEL$) and ~x50 speedup for classes that do not have MODEL$. Co-authored-by: radai <radai@fractal.lan>