Skip to content

perf: coalesce compose inspector refresh work - #709

Open
baron wants to merge 2 commits into
mainfrom
fix/pr-535-compose-refresh-performance
Open

perf: coalesce compose inspector refresh work#709
baron wants to merge 2 commits into
mainfrom
fix/pr-535-compose-refresh-performance

Conversation

@baron

@baron baron commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • skip redundant compose-inspector resolver work when token metrics complete with an identical already-published snapshot
  • stop the presenter wrapper from observing all runtime snapshot changes when only the drawer and token pill need that observation
  • prevent the token estimate pill from scheduling refresh work during SwiftUI body evaluation
  • extend coordinator coverage to prove identical completed snapshots do not trigger another resolve

Follow-up to #535 after a performance-focused audit.

Review notes

The audit also identified larger possible costs in full-content rereads for selected worktree files and periodic Git selection reconciliation. Those are intentionally deferred until measured; this PR keeps the change small and addresses only confirmed redundant invalidation/work.

A Fable 5 High design review caught an unsafe first attempt to coalesce in-flight refreshes: a failed or cancelled request could consume the only completion event. That optimization was removed, preserving retry semantics while retaining safe completed-snapshot coalescing.

Validation

  • make dev-test FILTER=AgentSelectedFilesModelCoordinatorTests — 29 tests, 0 failures
  • make dev-format — clean
  • make dev-lint — clean
  • contribution commit and push preflights — passed

The PR-ready full root suite completed with four failures in unrelated concurrency/timing tests:

  • CodemapBindingEngineInvalidationTests.testRequestReservationAndCancellationDuringValidatedReadReleaseExactlyOnce
  • DurableArtifactIdentityLeaseGCTests.testQuarantineGraceAbandonedWorkCleanupAndDirectOldVersionDeletion
  • WorkspaceCodemapBindingEngineObservabilityTests.testGraphIndexManifestPersistenceOccursOnceAtEnumerationSeal
  • WorkspaceFileContextStoreTests.testAggressiveAppliedIngressLimitsConcurrentRootFlushFanOut

The changed coordinator suite remained green. A focused rerun was queued but cancelled before acquiring the machine-wide heavy slot because another worktree held it; hosted exact-head CI should provide the final broad signal.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant