-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
transport: derive transport context from context.Background #2930
Conversation
Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement. After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.
Regards, |
Hey David, sorry about that! I believe I've rebased properly now. |
Hi @JNProtzman, Code looks good. Have you run any benchmarks to validate the performance improvement gained from the removal of the lock contention? It would be nice to see some numbers before merging this. |
Hey @canguler,
Looks to be nearly a 1% performance increase! If there is a better way to attach output in the future, please let me know :) |
You could also use https://github.com/grpc/grpc-go/blob/master/benchmark/benchresult/main.go to compare the old and new numbers side-by-side. |
Thanks for the info @easwars!
|
It looks like you have used a value for 1s for benchTime. Might want to run it with something larger like 30s or 60s to get a better idea. |
I've set benchTime to 60s and re-run :)
|
Can you run benchmarks in streaming and unconstrained streaming modes as well? Thanks! |
Here's streaming:
and unconstrained:
|
Hi @JNProtzman, Can you run tests multiple times, say at least 10 each? Because the results are not very clear and I think this may be due to the variance from run to run. |
Friendly ping |
My apologies for the delay. I've run the requested tests, 10x each. I've attached a zip archive with the output (in .txt files). Please let me know if this works, or if you need further information / test runs. |
I ran the benchmark on the current results without sync.Once and the previous results before my 2 commits. Here's the result comparisons: |
Avoid lock contention by deriving the transport context from context.Background() (without wrapping in a Cancel/Deadline context). This will make canceling a child context not recurse into the parent.
#1918