Skip to content

Coalesce the global command re-query - #4164

Open
siegfriedpammer wants to merge 1 commit into
masterfrom
perf/coalesce-command-requery
Open

siegfriedpammer wants to merge 1 commit into
masterfrom
perf/coalesce-command-requery

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

Command re-query walks bound commands and re-evaluates CanExecute. Post one background-priority raise for a burst of invalidations so callers do not pay that cost once per state change.

Verification: not run separately; split from #4157.


This PR description was written by an AI agent (OpenCode gpt-5.5) working under @siegfriedpammer's direction.

A raise walks every bound menu item and toolbar button and re-evaluates
its CanExecute, so a caller reporting a burst of state changes paid for
that walk once per change. WPF's CommandManager, which this class
documents itself as mirroring, coalesces to an idle-priority raise; do
the same. The pending flag stays set for the duration of the raise, so an
invalidation issued by a CanExecute handler folds into the raise in
progress instead of posting another one and never draining.

Assisted-by: Claude:claude-opus-5[1m]:Claude Code
Assisted-by: OpenCode:openai/gpt-5.5:OpenCode
@siegfriedpammer
siegfriedpammer force-pushed the perf/coalesce-command-requery branch from 0593a53 to 1ee8b32 Compare September 21, 2026 15:52

This branch has not been deployed

No deployments
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