Skip to content

perf(xds): maintain the dependency set incrementally instead of full rebuild per event #539

Closed

Description

@bpalermo

agent/internal/xds/cache/dependencies.go:140-212 — dependencySetLocked() rebuilds the set from scratch (loops over podDeps, observedDeps, staticDeps, serviceChainFilters, effectiveServiceRoutes, route backends, L4 route backends) and is called per pod event, per GAMMA update, per refresh — plus extra calls to diff before/after in change-signal paths.

Fix: either maintain the set incrementally (apply deltas on add/remove) or memoize keyed on an input-generation counter bumped by the mutators, so unchanged inputs return the cached set. Preserve exact set semantics (retention/TTL of observed deps, route-backend expansion) — behavior must be identical, only recompute frequency changes.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions