docs(vscode): analyze webview tab vs sidebar performance differences#7303
docs(vscode): analyze webview tab vs sidebar performance differences#7303kilo-code-bot[bot] wants to merge 1 commit into
Conversation
…erences Investigates potential performance issues when the extension webview runs in an editor tab compared to the default sidebar, identifying unthrottled per-token streaming, lack of visibility-aware message gating, and duplicate KiloProvider processing as the primary factors.
|
|
||
| - `KiloProvider.postMessage()` (`src/KiloProvider.ts:2606-2622`) fires unconditionally regardless of whether the webview is visible | ||
| - The webview JS has no `visibilitychange` listener and no `document.hidden` checks | ||
| - `WebviewView` (sidebar) does not expose `onDidChangeViewState` -- the extension cannot detect sidebar visibility changes at all |
There was a problem hiding this comment.
WARNING: Sidebar visibility detection is described inconsistently
The recommendation section later points to WebviewView.onDidChangeVisibility, and this extension already targets VS Code ^1.108.0. Framing sidebar visibility changes as impossible turns this from "not implemented today" into "cannot be done", which changes the conclusion of finding #2.
| - `WebviewView` (sidebar) does not expose `onDidChangeViewState` -- the extension cannot detect sidebar visibility changes at all | |
| - `WebviewView` (sidebar) is not currently using visibility APIs, so sidebar updates are never gated on visibility |
|
|
||
| **Tab impact:** An editor tab typically occupies 2-4x the pixel area of the sidebar. Wider viewports mean: | ||
|
|
||
| - Text wraps less, producing taller rendered messages |
There was a problem hiding this comment.
SUGGESTION: This bullet describes the wrap behavior backwards
A wider viewport means lines wrap less, so each rendered message is typically shorter rather than taller.
| - Text wraps less, producing taller rendered messages | |
| - Text wraps less, producing shorter rendered messages |
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
SUGGESTION
Other Observations (not in diff)No issues found in unchanged code that required summary-only notes. Files Reviewed (1 files)
Reviewed by gpt-5.4-20260305 · 437,344 tokens |
Summary
Key Findings
postMessagecalls during streaming overwhelm the webview. The codebase already documents this as a planned improvement insdk-sse-adapter.ts:22-27.resolveWebviewView()andresolveWebviewPanel()use the same HTML, bundle, and message handling — no tab-specific logic exists.This is a research/analysis document only — no behavioral changes.