Skip to content

Cache per-asset constraint map in graph view#76

Merged
VPDPersonal merged 1 commit into
feature/serialize-reference-dropdownfrom
perf/sr-graph-view-constraint-cache
Jun 23, 2026
Merged

Cache per-asset constraint map in graph view#76
VPDPersonal merged 1 commit into
feature/serialize-reference-dropdownfrom
perf/sr-graph-view-constraint-cache

Conversation

@VPDPersonal

Copy link
Copy Markdown
Owner

Summary

  • Cache the per-asset managed-reference constraint map in SerializeReferenceGraphView so opening the "Fix Missing" / "Change" picker no longer re-runs BuildConstraintMap (a LoadAllAssetsAtPath + full SerializedObject walk) on every card click.
  • Mirror the existing SerializeReferenceProjectView pattern: an instance _constraintCache keyed by asset path, populated lazily in ResolveConstraint (now an instance method) and cleared at the top of Rescan (which every apply path funnels through) so a fix's rewritten YAML is re-read.

Notes for review

  • _constraintCache.Clear() lives at the start of Rescan; ApplyFix, ClearReference, ApplyLive, and ClearOrphan all end by calling Rescan, so the cache can never serve a map staled by an in-view edit.
  • Keyed by asset path (not a single map) so a multi-document asset still shares one map across its cards while staying correct if the target ever changes.

Linked issues

Refs #49 - addresses review finding #49 (comment)

@VPDPersonal VPDPersonal added type: performance Performance improvement status: needs-review Ready for review area: editor Editor-only code labels Jun 21, 2026
@VPDPersonal VPDPersonal merged commit be5b185 into feature/serialize-reference-dropdown Jun 23, 2026
1 check passed
@VPDPersonal VPDPersonal deleted the perf/sr-graph-view-constraint-cache branch June 23, 2026 14:04
@github-actions github-actions Bot removed the status: needs-review Ready for review label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: editor Editor-only code type: performance Performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant