Skip to content

perf: fix memory leaks, improve build performance, and optimize compi…#307853

Open
InSelfControll wants to merge 1 commit intomicrosoft:mainfrom
InSelfControll:main
Open

perf: fix memory leaks, improve build performance, and optimize compi…#307853
InSelfControll wants to merge 1 commit intomicrosoft:mainfrom
InSelfControll:main

Conversation

@InSelfControll
Copy link
Copy Markdown

@InSelfControll InSelfControll commented Apr 4, 2026

Memory Leak Fixes:

  • Fix _instanceDisposables leak in TerminalGroup.dispose() - event listener disposables were never cleaned up when terminal groups were disposed
  • Fix _backgroundedTerminalDisposables leak in TerminalService - added override dispose() to clean up background terminal disposables
  • Fix terminal link cache leak in ExtHostTerminalService._onProcessExit() - _terminalLinkCache and _terminalLinkCancellationSource were never cleaned up when terminals exited
  • Add LRU eviction to ExtHostChatContext._globalItems - capped at 10,000 items to prevent unbounded memory growth from AI chat context items
  • Convert IDisposable[] to DisposableStore in notebook.contribution.ts (CellInfoContentProvider and NotebookMetadataContentProvider) for more robust disposal patterns

Build Performance Fixes (x64/x86 compilation speed):

  • Enable TypeScript incremental compilation in tsconfig.json and tsconfig.base.json - expected 50-70% faster recompilation
  • Add npm_config_jobs=max for native module compilation in postinstall.ts - allows node-gyp to use all CPU cores during native addon builds
  • Increase gulp memory limit from 8GB to 16GB in package.json to reduce GC thrashing during large builds
  • Add rspack splitChunks optimization with vendor and common cache groups
  • Add vite production optimizations: esbuild minification, sourcemaps, and manual chunk splitting for vendor/xterm dependencies

…lation

Memory Leak Fixes:
- Fix _instanceDisposables leak in TerminalGroup.dispose() - event listener
  disposables were never cleaned up when terminal groups were disposed
- Fix _backgroundedTerminalDisposables leak in TerminalService - added
  override dispose() to clean up background terminal disposables
- Fix terminal link cache leak in ExtHostTerminalService._onProcessExit() -
  _terminalLinkCache and _terminalLinkCancellationSource were never cleaned
  up when terminals exited
- Add LRU eviction to ExtHostChatContext._globalItems - capped at 10,000
  items to prevent unbounded memory growth from AI chat context items
- Convert IDisposable[] to DisposableStore in notebook.contribution.ts
  (CellInfoContentProvider and NotebookMetadataContentProvider) for more
  robust disposal patterns

Build Performance Fixes (x64/x86 compilation speed):
- Enable TypeScript incremental compilation in tsconfig.json and
  tsconfig.base.json - expected 50-70% faster recompilation
- Add npm_config_jobs=max for native module compilation in postinstall.ts -
  allows node-gyp to use all CPU cores during native addon builds
- Increase gulp memory limit from 8GB to 16GB in package.json to reduce
  GC thrashing during large builds
- Add rspack splitChunks optimization with vendor and common cache groups
- Add vite production optimizations: esbuild minification, sourcemaps,
  and manual chunk splitting for vendor/xterm dependencies
@InSelfControll
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

2 participants