mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 22:12:23 +00:00
fc50f61cdb
Rebuilding the registry view caches resolved each resource's metrics target by scanning every bySource mapping, an O(resources x mappings) pass holding the write lock. At about five thousand resources that is tens of millions of map iterations per rebuild, and rebuilds run on every poll cycle. The rebuild now inverts the mappings once and the cached index also serves single-resource lookups while the views are clean, with the legacy scan kept for dirty-state callers. An equivalence test pins index results to the legacy scan. The agent-parent fallback scan also ran its per-entry string canonicalization before the type check, so every guest in the estate paid allocation cost in a scan that only ever matches agents. The cheap checks now run first. Contract-Neutral: performance-only rework of metrics-target resolution and scan ordering, resolved values are pinned unchanged by equivalence tests