upstream: optimize LRS locality stats allocation - #46449
Open
birenroy wants to merge 1 commit into
Open
Conversation
Avoid stack allocation and copy of UpstreamLocalityStats in LRS by constructing it directly on the cluster stats message. TAG=agy CONV=24f630d4-0ff9-4691-8e6e-d12bb8fa3e82 Signed-off-by: Biren Roy <birenroy@google.com>
birenroy
marked this pull request as ready for review
July 30, 2026 19:30
Contributor
Author
|
/assign @adisuissa |
adisuissa
reviewed
Jul 31, 2026
adisuissa
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks!
/assign-from @envoyproxy/senior-maintainers
| envoy::config::endpoint::v3::UpstreamLocalityStats locality_stats; | ||
| locality_stats.mutable_locality()->MergeFrom(hosts[0]->locality()); | ||
| locality_stats.set_priority(host_set->priority()); | ||
| auto* locality_stats = cluster_stats->add_upstream_locality_stats(); |
Contributor
There was a problem hiding this comment.
Please add a comment here describing that this may be removed later if no local stats will need to be sent.
|
@envoyproxy/senior-maintainers assignee is @yanavlasov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoids stack allocation and copy of
UpstreamLocalityStatsin LRS by constructing the message directly on the cluster stats message.This change was created with the help of the Gemini AI model. I have read and understand the code.
Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features: