Baruch Shushi created AVRO-2939:
-----------------------------------
Summary: SpecificData.getForClass() cause performance degradation
Key: AVRO-2939
URL: https://issues.apache.org/jira/browse/AVRO-2939
Project: Apache Avro
Issue Type: New Feature
Components: java
Affects Versions: 1.9.2, 1.9.1, 1.10.0
Reporter: Baruch Shushi
Every generated Object.newBuilder() has downstream call to
SpecificData.getForClass() since version 1.9.X which is ~37 times slower than
version 1.8.2.
This is due to the NoSuchFieldException thrown on every Builder instantiation.
Sample code to run the benchmarks can be found
[here|https://github.com/baruchshushi/avro-performance-degradation]
*JMH results for 1.8.2:*
Result "com.example.Main.benchmark":
24.877 ±(99.9%) 0.153 ms/op [Average]
(min, avg, max) = (24.426, 24.877, 25.542), stdev = 0.272
CI (99.9%): [24.724, 25.030] (assumes normal distribution)
*JMH results for 1.10.0:*
Result "com.example.Main.benchmark":
923.214 ±(99.9%) 28.436 ms/op [Average]
(min, avg, max) = (858.940, 923.214, 989.746), stdev = 50.545
CI (99.9%): [894.778, 951.650] (assumes normal distribution)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)