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

How to benchmark performance changes #793

Closed
vaughanr opened this issue Feb 26, 2020 · 2 comments
Closed

How to benchmark performance changes #793

vaughanr opened this issue Feb 26, 2020 · 2 comments
Labels
question Further information is requested

Comments

@vaughanr
Copy link
Contributor

Hi,

I've made a small change in my fork to use a local function to avoid an allocation in the GrpcChannel class.

vaughanr@9209782

I think it would but would like to supply hard evidence in the same way that @JamesNK often does in his PRs eg: #775

  1. Would you be open to these sorts of PRs with evidence?

  2. I assume I should use the Grpc.AspNetCore.Microbenchmarks project. Is there a run option that you always use?

@vaughanr vaughanr added the question Further information is requested label Feb 26, 2020
@JamesNK
Copy link
Member

JamesNK commented Feb 26, 2020

The dictionary needs a func so one must be allocated at some point. The current code ensures the func is only allocated once for the channel, rather than every call to GetCachedGrpcMethodInfo. I believe your code change will allocate every call.

Measuring is definitely required whenever making changes for perf.

@vaughanr
Copy link
Contributor Author

Yes I see that now, thank you for having a look. I saved an allocation on creating a channel but cost one every time it was used! If I attempt one again I will get some evidence before I ask the question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants