Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization to avoid excessing reflection #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

avinashkolluru
Copy link
Contributor

Description

Optimization for bypassing the newBuilder() in Avro classes uses SpecificData.getForSchema which uses reflection(Class.forName) for loading the class

@codecov
Copy link

codecov bot commented Jul 31, 2021

Codecov Report

Merging #242 (2357bd1) into main (4cc59db) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #242   +/-   ##
=========================================
  Coverage     80.39%   80.39%           
- Complexity     1149     1150    +1     
=========================================
  Files           101      101           
  Lines          4437     4438    +1     
  Branches        414      414           
=========================================
+ Hits           3567     3568    +1     
  Misses          675      675           
  Partials        195      195           
Flag Coverage Δ
unit 80.39% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...ore/spannormalizer/util/JaegerHTTagsConverter.java 34.61% <100.00%> (+2.61%) ⬆️

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 4cc59db...2357bd1. Read the comment docs.

@github-actions
Copy link

Unit Test Results

  69 files  ±0    69 suites  ±0   46s ⏱️ -1s
365 tests ±0  365 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 2357bd1. ± Comparison against base commit 4cc59db.

// This may be too expensive when being done at a large scale(like in the case of
// AttributeValue).
// By using an existing empty builder to create a new builder we are bypassing the reflection
AttributeValue.Builder valueBuilder = AttributeValue.newBuilder(ATTRIBUTE_VALUE_BUILDER);
Copy link
Contributor

Choose a reason for hiding this comment

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

That's interesting to know!

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