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

core, api, benchmarks: Random acts of garbage reduction #7375

Merged
merged 3 commits into from
Jan 21, 2021

Conversation

njhill
Copy link
Contributor

@njhill njhill commented Aug 28, 2020

I noticed some opportunities to reduce allocations on hot paths

I noticed some opportunities to reduce allocations on hot paths
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

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

The UnsafeByteOperations change is the only reason I'm not approving right now (although I wouldn't merge). I do think there are some tweaks that could be made.

api/src/main/java/io/grpc/CallOptions.java Show resolved Hide resolved
benchmarks/src/main/java/io/grpc/benchmarks/Utils.java Outdated Show resolved Hide resolved
return offset + length;
}
};

@Override
public void readBytes(final byte[] dest, final int destOffset, int length) {
Copy link
Member

Choose a reason for hiding this comment

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

You might want to clean up the now-unnecessary finals. Not a big deal.

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 3, 2020
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 3, 2020
@njhill
Copy link
Contributor Author

njhill commented Nov 4, 2020

Thanks @ejona86! I will address the comments when I get a chance but likely won't be until next week.

@ejona86
Copy link
Member

ejona86 commented Nov 4, 2020

@njhill, that's more than fine. I'm sorry it took so very long for us to review.

And in case it wasn't clear, I'm fine with accepting the garbage reduction changes that probably don't reduce garbage. It's a PITA to check whether the JIT is actually doing what we hope and that still depends on what side of the bed the JIT woke up on. Since the changes don't harm readability, they seem fine. But I pointed them out since the value of those sorts of changes is questionable and we may not want to get out-of-hand with that class of change.

@njhill
Copy link
Contributor Author

njhill commented Jan 1, 2021

@ejona86 I think I've addressed all the comments, PTAL

I did also try to rebase this branch but it wouldn't let me push that:

!	refs/heads/garbage:refs/heads/garbage	[remote rejected] (refusing to allow an OAuth App to create or update workflow `.github/workflows/gradle-wrapper-validation.yml` without `workflow` scope

@ejona86
Copy link
Member

ejona86 commented Jan 5, 2021

I did also try to rebase this branch but it wouldn't let me push that:

@njhill, that error doesn't look related to the force push. We have a github workflow now, so it looks like that error would apply every time you try to push to your repo with newer PRs. I don't know how you are authenticating, but maybe you need to go through that process again so it can request more more scopes.

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jan 5, 2021
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jan 5, 2021
@ejona86
Copy link
Member

ejona86 commented Jan 8, 2021

@voidzcy, could you review?

@voidzcy
Copy link
Contributor

voidzcy commented Jan 18, 2021

CI failures need to be addressed (missing imports).

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jan 21, 2021
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jan 21, 2021
@ejona86 ejona86 merged commit 2072df9 into grpc:master Jan 21, 2021
@ejona86
Copy link
Member

ejona86 commented Jan 21, 2021

Thank you @njhill!

@njhill njhill deleted the garbage branch January 21, 2021 19:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants