Skip to content

eds: key LEDS maps by collection name string instead of protobuf#43820

Open
wdauchy wants to merge 1 commit intoenvoyproxy:mainfrom
wdauchy:wdauchy/leds-optimize-map-lookups
Open

eds: key LEDS maps by collection name string instead of protobuf#43820
wdauchy wants to merge 1 commit intoenvoyproxy:mainfrom
wdauchy:wdauchy/leds-optimize-map-lookups

Conversation

@wdauchy
Copy link
Contributor

@wdauchy wdauchy commented Mar 6, 2026

Commit Message:
LedsConfigMap and LedsConfigSet used the full LedsClusterLocalityConfig protobuf as key with MessageUtil, which does TextFormat::PrintToString for hashing and MessageDifferencer::Equals for comparison on every lookup. Since the leds_collection_name xDSTP URL uniquely identifies a LEDS subscription, use it as a plain string key instead.

This also fixes a triple hash-map lookup in batchUpdate() (find, operator[], operator[] again) by reusing the iterator from a single find() call.
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:]

@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #43820 was opened by wdauchy.

see: more, trace.

@wdauchy wdauchy force-pushed the wdauchy/leds-optimize-map-lookups branch from f1d51ed to c0969aa Compare March 6, 2026 13:45
LedsConfigMap and LedsConfigSet used the full LedsClusterLocalityConfig
protobuf as key with MessageUtil, which does TextFormat::PrintToString
for hashing and MessageDifferencer::Equals for comparison on every
lookup. Since the leds_collection_name xDSTP URL uniquely identifies
a LEDS subscription, use it as a plain string key instead.

This also fixes a triple hash-map lookup in batchUpdate() (find,
operator[], operator[] again) by reusing the iterator from a single
find() call.

Signed-off-by: William Dauchy <william.dauchy@datadoghq.com>
@wdauchy wdauchy force-pushed the wdauchy/leds-optimize-map-lookups branch from c0969aa to dad9efe Compare March 6, 2026 14:49
@wdauchy wdauchy marked this pull request as ready for review March 6, 2026 14:49
@wdauchy
Copy link
Contributor Author

wdauchy commented Mar 6, 2026

/retest transients

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant