Skip to content

bugfix: Avro reflection cache#30

Merged
laxman-traceable merged 5 commits intomainfrom
avro-reflection-cache
Oct 27, 2021
Merged

bugfix: Avro reflection cache#30
laxman-traceable merged 5 commits intomainfrom
avro-reflection-cache

Conversation

@laxman-traceable
Copy link
Copy Markdown
Contributor

Description

Utility class to instantiate a new avro builder in a fast and efficient way. Default Avro implementation has a perf issue due to uncached reflection based implementation. For more details, https://issues.apache.org/jira/browse/AVRO-3048

This avro perf bug is fixed in unreleased avro version (0.11.x). We can get rid of this utility class once we migrate to Avro 0.11.x or above.

Testing

Unit tests added

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

NA

@github-actions

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 27, 2021

Codecov Report

Merging #30 (51ca9f0) into main (321654e) will increase coverage by 0.44%.
The diff coverage is 74.41%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #30      +/-   ##
============================================
+ Coverage     66.10%   66.54%   +0.44%     
- Complexity      107      115       +8     
============================================
  Files            12       13       +1     
  Lines           531      559      +28     
  Branches         91       91              
============================================
+ Hits            351      372      +21     
- Misses          159      166       +7     
  Partials         21       21              
Flag Coverage Δ
unit 66.54% <74.41%> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...race/core/datamodel/shared/SpanAttributeUtils.java 0.00% <0.00%> (ø)
.../datamodel/shared/trace/AttributeValueCreator.java 70.00% <60.00%> (ø)
...ore/datamodel/shared/trace/MetricValueCreator.java 50.00% <66.66%> (ø)
...rtrace/core/datamodel/shared/AvroBuilderCache.java 73.07% <73.07%> (ø)
...datamodel/shared/trace/StructuredTraceBuilder.java 84.21% <100.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 321654e...51ca9f0. Read the comment docs.

@github-actions

This comment has been minimized.

SpecificRecordBuilderBase builderModel =
(SpecificRecordBuilderBase) declaredConstructor.newInstance();

return Pair.of(newBuilderMethod, builderModel);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to pass the instance declaredConstructor.newInstance()? Is this class instance, right? So, it will be used by the builder of creating an object, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are creating a default builder instance once per avro class and using it as blue print to create other builder instances to reduce the reflection overhead.

Copy link
Copy Markdown
Contributor

@kotharironak kotharironak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions

This comment has been minimized.

@laxman-traceable laxman-traceable merged commit 6d17864 into main Oct 27, 2021
@laxman-traceable laxman-traceable deleted the avro-reflection-cache branch October 27, 2021 08:32
@github-actions
Copy link
Copy Markdown

Unit Test Results

  7 files  +1    7 suites  +1   2s ⏱️ -1s
13 tests +1  13 ✔️ +1  0 💤 ±0  0 ❌ ±0 

Results for commit 6d17864. ± Comparison against base commit 321654e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants