Skip to content

perf: reduce memory usage by 24 kB - #342397

Merged
Martin Aeschlimann (aeschli) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-colorRegistry
Nov 5, 2026
Merged

Martin Aeschlimann (aeschli) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-colorRegistry

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Share the default-color schema object across registered theme colors so each color no longer keeps its own identical copy. In a test that opened and closed an editor once, this removed 993 duplicate objects, saving 23.3 KiB of renderer memory.


AI disclosure: Model: gpt-6.1-sol. Worktime: 1 min

Copilot AI balanced review requested due to automatic review settings October 18, 2026 15:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow change preserves schema content, and no actionable findings remain.

No open issues 🎉

What changed in this PR

Reduces theme-color registry memory usage by sharing the identical default-color schema across registered colors.

Changes:

  • Creates one default-color schema per registry.
  • Reuses it during color registration without changing schema content.
File Description
src/​vs/​platform/​theme/​common/​colorUtils.ts Shares the default-color schema instead of allocating it per color.

Review effort: Balanced

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

@aeschli
Martin Aeschlimann (aeschli) merged commit da361b8 into microsoft:main Nov 5, 2026
59 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 5, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-colorRegistry branch November 5, 2026 11:28
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.

7 participants