Repository navigation
perf: reduce memory usage by 44 kB - #342392
Merged
Dmitriy Vasyura (dmitrivMS) merged 6 commits intoNov 13, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 6 commits into
Dmitriy Vasyura (dmitrivMS) merged 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused optimization has regression coverage, and no blocking defects were identified.
No open issues 🎉
What changed in this PR
Reduces memory allocations in VS Code’s Command Palette by sharing match results for empty searches.
Changes:
- Reuses one empty-query match array and object across substring and fuzzy filters.
- Prevents icon-offset adjustments from mutating shared matches.
- Adds regression tests for sharing and icon/whitespace handling.
| File | Description |
|---|---|
| src/vs/base/test/common/iconLabels.test.ts | Tests shared matches across icon and whitespace variations. |
| src/vs/base/test/common/filters.test.ts | Tests empty-query result sharing across filters. |
| src/vs/base/common/iconLabels.ts | Skips offset adjustments for shared matches. |
| src/vs/base/common/filters.ts | Introduces and reuses shared empty-query matches. |
Review effort: Balanced
Dmitriy Vasyura (dmitrivMS)
requested changes
Nov 11, 2026
Dmitriy Vasyura (dmitrivMS)
left a comment
Collaborator
There was a problem hiding this comment.
Please consider my comment
Contributor
Author
|
Done. |
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
November 12, 2026 21:52
Dmitriy Vasyura (dmitrivMS)
approved these changes
Nov 12, 2026
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
Anthony Kim (anthonykim1)
approved these changes
Nov 13, 2026
Bhavya U (bhavyaus)
approved these changes
Nov 13, 2026
Dmitriy Vasyura (dmitrivMS)
merged commit Nov 13, 2026
6e57ff5
into
microsoft:main
52 of 53 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Share the match object and highlight array for empty searches so each Command Palette entry no longer keeps its own copy. In a test that opened and closed an editor 17 times, this removed 941 duplicate objects and 941 duplicate arrays, saving 44.1 KiB of renderer memory.
AI disclosure: Model: GPT-6. Worktime: 2 min