eds: pass ClusterLoadAssignment by value to enable move semantics#43700
Open
wdauchy wants to merge 2 commits intoenvoyproxy:mainfrom
Open
eds: pass ClusterLoadAssignment by value to enable move semantics#43700wdauchy wants to merge 2 commits intoenvoyproxy:mainfrom
wdauchy wants to merge 2 commits intoenvoyproxy:mainfrom
Conversation
Contributor
|
Do we have any EDS benchmarks? |
adisuissa
reviewed
Mar 3, 2026
Contributor
adisuissa
left a comment
There was a problem hiding this comment.
LGTM, thanks!
Left a minor comment.
Assigning a senior-maintainer as required by review guidelines.
/assign-from @envoyproxy/senior-maintainers
|
@envoyproxy/senior-maintainers assignee is @botengyao |
Contributor
Author
I am not sure about that :/ |
Contributor
Author
|
/retest transients |
Contributor
Author
|
/retest |
Contributor
Author
|
/retest transients |
update() took a const reference, making the std::move inside it a no-op: std::move on a const& yields a const&& which resolves to the copy constructor, so every EDS config update deep-copied the entire ClusterLoadAssignment protobuf (all endpoints, localities, addresses, metadata) into the unique_ptr. Accept by value so callers can move their local variables in. The protobuf move constructor swaps internal pointers in O(1) regardless of message size, replacing what was a full recursive copy with two pointer swaps. This matters on the EDS hot path for large clusters where the control plane pushes frequent endpoint updates. Signed-off-by: William Dauchy <william.dauchy@datadoghq.com>
Signed-off-by: William Dauchy <william.dauchy@datadoghq.com>
eeb1c1a to
22c81cb
Compare
Contributor
Author
|
/retest transients |
Contributor
Author
|
/retest transients |
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.
Commit Message:
update() took a const reference, making the std::move inside it a no-op: std::move on a const& yields a const&& which resolves to the copy constructor, so every EDS config update deep-copied the entire ClusterLoadAssignment protobuf (all endpoints, localities, addresses, metadata) into the unique_ptr.
Accept by value so callers can move their local variables in. The protobuf move constructor swaps internal pointers in O(1) regardless of message size, replacing what was a full recursive copy with two pointer swaps. This matters on the EDS hot path for large clusters where the control plane pushes frequent endpoint updates.
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]