Commit 3b607e2
committed
upstream: use hash instead of MessageDifferencer for metadata/locality comparison
Replace Protobuf::util::MessageDifferencer with MessageUtil::hash for
equality checks in hot paths to reduce CPU during large EDS updates:
- updateDynamicHostList: metadata comparison (upstream_impl.cc)
- LocalityEndpointEqualTo: locality/endpoint comparison (locality_endpoint.h)
Hash comparison is typically faster than reflection-based MessageDifferencer
and matches Envoy's MessageLiteDifferencer approach when full protos are
disabled. Helps with clusters of ~5k endpoints where these comparisons run
per host on each EDS update.
Signed-off-by: William Dauchy <william.dauchy@datadoghq.com>1 parent 268671e commit 3b607e2
2 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2343 | 2343 | | |
2344 | 2344 | | |
2345 | 2345 | | |
2346 | | - | |
| 2346 | + | |
2347 | 2347 | | |
2348 | 2348 | | |
2349 | | - | |
2350 | | - | |
| 2349 | + | |
| 2350 | + | |
2351 | 2351 | | |
2352 | 2352 | | |
2353 | 2353 | | |
| |||
0 commit comments