Skip to content

[Task][Performance] Batch namespace snapshot cache updates and invalidation #7645

Closed

Description

@Aias00

Performance baseline and program tracking: #7650.

Goal

Reduce repeated list copying, sorting and match-cache invalidation during initial synchronization and reconnect snapshots while preserving configuration semantics.

Current evidence

CommonPluginDataSubscriber.applySelectorDataSnapshot/applyRuleDataSnapshot calls per-item subscribe methods. These reach single-item upserts and invalidation. BaseDataCache already has grouped batch-refresh helpers that merge and sort once per key, so reuse existing machinery where its semantics fit. A snapshot also removes stale namespace entries; existing merge helpers alone are not a replacement for snapshot semantics.

Source at reviewed commit

Related historical work: #6796 addressed repeated sorting in cache refresh paths; this issue focuses on namespace snapshot application at the reviewed commit.

Scope and acceptance criteria

  • Group selector updates per plugin and rule updates per selector; merge/sort once per affected group.
  • Coalesce appropriate match-cache invalidation without retaining stale positive or negative results.
  • Preserve plugin-handler callbacks, deletion semantics, ordering, namespace isolation and empty-snapshot cleanup.
  • Define/test ordering against concurrent incremental updates; do not claim whole-system atomicity from per-list replacement.
  • Benchmark 1k/10k+ configurations with a fixed shape, both cold initialization and reconnect, while business requests run.
  • Report snapshot apply time, allocations/GC, convergence and business p99 disturbance; final configuration and routing match the reference behavior.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions