-
Notifications
You must be signed in to change notification settings - Fork 469
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
feat(translator): use upstreamMap instead of for loop in upstreams array #7974
feat(translator): use upstreamMap instead of for loop in upstreams array #7974
Conversation
Waiting for approval from someone in the solo-io org to start testing. |
Issues linked to changelog: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weixiao-huang thanks for the contribution! I like the idea here, and agree that there are some improvements we can introduce to the UpstreamList.Find functionality which currently iterates over a list instead of a quick lookup in a map.
We have an ongoing issue solo-io/solo-kit#521 to track improving the Find performance not just for Upstreams, but all types. I would rather introduce it collectively than just for a single type.
How about we move forward with the following plan:
- If you can document the performance gains from this PR alone, you add a comment on this PR outlining the improvement
- I will migrate the issue I linked into the Gloo repository so there is more awareness around it
- We close out this PR, and link it in the Gloo issue. Then we use the performance measurements as a way to try to prioritize the value of this work.
How does that sound to you?
This will help us understand the significance of this work as well, as @sam-heilbron has mentioned. You mentioned tens of thousands in the issue, so I am left to believe this is your scale? |
Sorry for my delay, I'd like to ask whether I should move this PR to solo-kit or just remain it in gloo? Another question is that which performance gains should I add? Is there a template? |
We don't have a template unfortunately. Any findings you have can be documented here. For example "i applied X upstreams and Y virtual services, and translation took N seconds before this change and M seconds after this change". if you don't have those numbers that is ok too. I figured any proof of impact would help us argue for prioritizing this work on the Engineering team here. Once you add those details, or just respond saying you don't have them, I will do the following:
|
@weixiao-huang Are you able to provide any details about the scale you were running and the improvements that you measured? If not, that's ok, I just wanted to make sure we had that context if it was available. Since this is a change that we can do more broadly in the product, I would like to close this PR and I will raise the issue internally. Will that work for you? |
Sorry for my delay, I'll check it and provide details before 31st May. |
I'm sorry but I'm busy in these days, I'll provide it before 12th June. |
It seems not easy to reproduce and get a benchmark. Is there any progress for solo-io/solo-kit#521 ? I've found 404 for https://github.com/solo-io/solo-projects/pull/4077 in this issue. Could I try to add a PR for changing for loop to map more generic in solo-kit? |
I've created solo-io#8988 to track this request in a more public space (this repository) so that others who have feedback on the urgency of it, or ideas for solving it can participate. Given that this PR is a good start to a solution, but does not solve the problem holistically, I would vote that we close it. If you are interested in trying to solve this issue as written in solo-kit to provide this enhancement, that would be amazing! |
Description
This PR use upstreamMap instead of for loop of array and fixes solo-io#7973
Context
see solo-io#7973
Checklist:
make -B install-go-tools generated-code
to ensure there will be no code diffBOT NOTES:
resolves solo-io#7973