Skip to content

fix(vscode): simplify marketplace README rendering#8073

Closed
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
fix/vscode-marketplace-readme-cpu
Closed

fix(vscode): simplify marketplace README rendering#8073
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
fix/vscode-marketplace-readme-cpu

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Apr 1, 2026

Summary

  • replace the VS Code Marketplace README with a plain Markdown version that removes embedded remote images, HTML tables, and the contributor avatar gallery
  • add a unit test that blocks future reintroduction of embedded images or <table> markup into packages/kilo-vscode/README.md
  • document the performance rationale here so the change is traceable even if the original user report is hard to reproduce locally

Problem

Opening this extension's README from the VS Code Marketplace view can drive CPU usage extremely high. The old README was unusually expensive for the markdown renderer because it combined three patterns that are all known to stress VS Code's markdown/extension-details rendering path:

  1. Many remote image fetches on initial render

    • The README referenced 15 remote images.
    • Those included 5 shields badges from raster.shields.io, 8 contributor avatars from avatars.githubusercontent.com, and 1 YouTube thumbnail from img.youtube.com.
    • A quick header check showed roughly 110 KB of image payload before accounting for response overhead, decoding, layout, retries, and cache misses.
  2. HTML-heavy markdown

    • The README used raw HTML for the badge row and a <table> with inline-styled contributor avatars.
    • VS Code Marketplace details pages do not render README content as static plain text; they pass it through the markdown pipeline and then into an Electron-rendered details view. Raw HTML plus external assets increases parse, sanitize, layout, and repaint work.
  3. A code path with prior VS Code perf issues

    • VS Code has multiple historical issues in this area:
      • microsoft/vscode#138409 - extension README loading time regression
      • microsoft/vscode#197868 - high CPU load from markdown-language-features
      • microsoft/vscode#165055 - markdown preview becomes unusable with many pictures
    • Those reports are not identical to this bug, but they establish that markdown rendering, especially with image-heavy content, has had real perf pathologies in VS Code.

Why this README can trigger 400% CPU

The most plausible mechanism is not that any single image is huge, but that the README creates a bursty render workload:

  • the extension details page parses markdown and raw HTML
  • the renderer issues many concurrent remote image requests
  • each image completion invalidates layout and repaint state
  • the HTML table + inline image dimensions force additional measurement work
  • markdown extensions / preview services may also continue processing the document in the background
  • if one of those services gets into a bad state, CPU can peg long after the page first becomes visible

That fits the reported symptom: simply opening the Marketplace README is enough to spike multiple cores, even though the extension code itself is not executing a heavy feature.

Fix

This PR takes the safe fix available from the extension side: make the Marketplace README cheap to render.

  • remove all embedded images
  • remove all raw HTML and the contributor avatar table
  • replace badges and thumbnail-driven call-to-actions with plain text links
  • keep the key product messaging, onboarding steps, community links, and developer commands

This does not require a VS Code platform change and directly reduces renderer work, network fan-out, and layout churn.

Why this fix is the right tradeoff

  • The problematic behavior occurs in a VS Code-controlled surface, so we cannot fully fix the renderer from this repository.
  • We can control the complexity of the document we feed into that renderer.
  • Marketplace READMEs should optimize for reliability and readability before visual embellishment.
  • Plain Markdown is also more robust across GitHub, the Marketplace website, the in-product extension page, and OpenVSX-like consumers.

Guardrail

packages/kilo-vscode/tests/unit/marketplace-readme.test.ts now verifies that the Marketplace README:

  • contains no embedded HTML or markdown images
  • contains no <table> markup
  • still preserves the core install/onboarding links

This makes the performance regression less likely to come back during future README edits.

Validation

  • ran bun test tests/unit/marketplace-readme.test.ts
  • manually inspected the rewritten README to confirm it preserves the main install, quick-start, community, and contribution links

Risk

Low.

  • Only Marketplace-facing documentation changed.
  • No runtime extension behavior changed.
  • The new test is isolated and documentation-focused.

Remove embedded images and HTML tables from the extension README so the VS Code marketplace view stays lightweight and avoids known markdown rendering slow paths.

function images(src: string) {
const html = [...src.matchAll(/<img\b[^>]*src=["']([^"']+)["'][^>]*>/gi)].map((m) => m[1])
const md = [...src.matchAll(/!\[[^\]]*\]\(([^)]+)\)/g)].map((m) => m[1])
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Regression test misses reference-style Markdown images

images() only matches inline ![alt](url) syntax. A future README change could reintroduce an embedded image with reference-style Markdown like ![alt][ref] plus [ref]: https://..., and this test would still pass even though the Marketplace would still render the image.

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot bot commented Apr 1, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/tests/unit/marketplace-readme.test.ts 12 The README regression test only detects inline Markdown images, so reference-style image syntax can reintroduce embedded images without failing the guardrail.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

None.

Files Reviewed (2 files)
  • packages/kilo-vscode/README.md - 0 issues
  • packages/kilo-vscode/tests/unit/marketplace-readme.test.ts - 1 issue

Reviewed by gpt-5.4-20260305 · 157,744 tokens

@markijbema markijbema closed this Apr 2, 2026
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