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

DRILL-7372: MethodAnalyzer consumes too much memory #1887

Closed
wants to merge 1 commit into from

Conversation

vvysotskyi
Copy link
Member

Jira: DRILL-7372.

  • Replaced Set<Integer> with BitSet - it allowed to reduce heap usage significantly.
  • Avoided copying localVariablesSet and labelsStack from the source frame when a new frame is created since the branch-sensitive analysis was already done for a source frame.

@vvysotskyi vvysotskyi changed the title DRILL-7372: MethodAnalyzer consumes too many memory DRILL-7372: MethodAnalyzer consumes too much memory Oct 31, 2019

@Override
public void clearStack() {
super.clearStack();
Copy link
Member

Choose a reason for hiding this comment

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

Consider nullification or empty collections re-assignement

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, done.

Copy link
Member Author

@vvysotskyi vvysotskyi left a comment

Choose a reason for hiding this comment

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

@arina-ielchiieva, thanks for the review, I have addressed your comment.


@Override
public void clearStack() {
super.clearStack();
Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, done.

@arina-ielchiieva
Copy link
Member

+1, LGTM.

@paul-rogers
Copy link
Contributor

Just a thought: we proved a couple of years back that the modern JVM does a perfectly fine job of scalar replacement. We also found performance benefits from using "plain Java" without class merging. As a result, our byte code analysis is no longer needed. Just flip one option and we can completely remove this code instead of continuing to maintain it.

@vvysotskyi
Copy link
Member Author

@paul-rogers, unfortunately, I didn't see the results of these performance measurements, but I believe that there are some corner cases where our byte code analysis will bring some benefit, for example, when the generated method is too large for JVM optimizations and general time for query execution is much larger compared to the time required for producing scalar replacement and classes merging.

@asfgit asfgit closed this in aba268a Nov 14, 2019
xiangt920 pushed a commit to xiangt920/drill that referenced this pull request Dec 26, 2019
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.

None yet

3 participants