Skip to content

Copilot Chat typing stutter - suggestModel.ts consuming 40% of scripting time #284878

@tharveysa

Description

@tharveysa

Trace-20251223T104426.zip

Issue Type: Performance

VS Code Version

1.107.1 (994fd12, x64)

OS Version

Windows 11

Description

Typing in Copilot Chat panel causes significant UI stuttering/lag. Performance profiling shows suggestModel.ts:338 consuming 40% of scripting self-time during chat input, even though suggestions aren't being displayed in the chat input.

Steps to Reproduce

  1. Open VS Code
  2. Open Copilot Chat panel (Ctrl+Alt+I)
  3. Start typing a message
  4. Observe stuttering/lag while typing

Performance Profile Findings

Captured a ~37 second trace while reproducing. Bottom-up analysis sorted by Self Time:

Self Time % Function Source
783.6 ms 40.1% y suggestModel.ts:338:10
342.3 ms 17.5% encode -
178.2 ms 9.1% send ipc.electron.ts:23:2
147.4 ms 7.5% send VM4 sandbox_bundle
98.9 ms 5.1% concat buffer.ts:849
76.5 ms 3.9% Major GC Garbage collection

The suggest model appears to be processing every keystroke in the chat input, triggering heavy IPC and encoding operations, causing the main thread to block.

Workaround

Adding these settings reduces the stutter:

{
  "editor.quickSuggestionsDelay": 500,
  "editor.suggest.delay": 500,
  "editor.inlineSuggest.suppressSuggestions": true
}

Expected Behavior

Typing in Copilot Chat should not trigger the editor's suggestion model processing, or should be debounced/throttled to prevent UI blocking.

Additional Context

  • Performance trace attached

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions