Let's be honest. We've all been there. You're in the zone, the code is flowing, and then... VSCode starts lagging. The cursor stutters, autocomplete takes a coffee break, and your laptop fan sounds like it's preparing for liftoff. It’s frustrating, it breaks your concentration, and frankly, it’s a massive productivity killer.
For the longest time, I just accepted this as the price of using a powerful, extensible editor. I’d sigh, close a few tabs, and pray for a miracle. That is, until I decided to dive deep into the belly of the beast and systematically optimize my setup. The result? I didn't just get a small speed boost; I transformed VSCode from a sluggish resource-hog into a lean, mean, coding machine that feels almost 10x faster.
The journey wasn't just about blindly copying settings from a forum. It was about understanding why VSCode gets slow and methodically applying fixes.
And hey, while we're talking about optimizing our developer workflow, if you're also tired of juggling between Postman, Swagger, and Mock servers for API work, you've got to check out Apidog.
In this post, I'm going to walk you through the exact settings and strategies I used. We'll go beyond the basic "disable an extension or two" and get into the nitty-gritty of file watching, TypeScript optimization, and hidden performance drains. Get ready to reclaim your development environment.
The Culprits: Why is Your VSCode So Slow?
Before we start applying fixes, it's crucial to understand what we're up against. Think of it like diagnosing a car; you don't just start replacing parts randomly. You need to know what's causing the knocking sound.
Through my investigation, I pinpointed three primary villains responsible for VSCode's performance woes:
- Extension Overload: This is, hands down, the number one culprit. Every extension you install is like a little app running inside VSCode. Some are well-behaved and lightweight, but others are resource-intensive monsters that can bring your entire editor to its knees. The problem compounds with each new extension you add.
- The File Watching Frenzy: VSCode has a built-in service that constantly watches your project files for changes. This is what powers features like the live file explorer update and the Git status in the sidebar. However, in large projects especially those with massive
node_modules,dist, orbuildfolders this file watcher can go into overdrive, consuming insane amounts of CPU and memory as it tries to track thousands upon thousands of files. - TypeScript & Language Server Strain: For those of us in the TypeScript/JavaScript world, the language server (which provides IntelliSense, error checking, and refactoring) is a miracle worker. But that power comes at a cost. On large codebases, the constant type-checking and analysis can be a significant drain on performance.
Now that we know the enemies, let's build our battle plan. We'll tackle these in order of impact.
Phase 1: The Extension Purge Your Most Powerful Lever
This is where you will see the most dramatic improvement. I went from 40 lazily-installed extensions down to 20 essential ones, and the difference wasn't just measurable it was palpable.
Step 1: Identify the Resource Hogs
First, you need to see which extensions are actually slowing you down. Fortunately, VSCode has fantastic built-in tools for this.
- Open the Command Palette with
Ctrl+Shift+P(orCmd+Shift+Pon Mac). - Type and run
Developer: Show Running Extensions.
This opens a panel that shows you every running extension and, most importantly, its "Activation Time." This is how long it takes for the extension to start up. Extensions with a high activation time are often the ones that have the biggest impact on your startup performance. Seeing this list for the first time was a real eye-opener for me.
Step 2: The Surgical Strike with Extension Bisect
What if you don't know which extension is causing the problem? Manually disabling them one by one is a pain. Enter one of VSCode's best-kept secrets: Extension Bisect.
- Open the Command Palette again and run
Developer: Start Extension Bisect.
This brilliant feature uses a binary search algorithm. It will disable half of your extensions and ask you if the problem is still there. You say yes or no, and it disables/enables another half, quickly narrowing down the culprit in just a few steps. It's like a detective systematically finding the bad actor in your extensions list.
Step 3: Ruthless Pruning and Workspace Management
Once you've identified the problematic or simply unused extensions, it's time to be ruthless.
- Disable Globally: For extensions you never use, just right-click and disable them globally.
- Disable by Workspace: This is a game-changer. You don't need your Python linter active in your React project, and vice versa. Right-click an extension and select "Disable (Workspace)". This keeps it enabled for other projects but turns it off for your current one, saving precious resources.
Furthermore, don't forget the built-in extensions. Search for @builtin in the extensions view. You might find default extensions for languages or frameworks you don't use. Disabling these can also provide a nice little performance bump.
The Results of My Extension Purge
Let's talk numbers. I measured my VSCode startup performance before and after the great extension purge. The results were staggering:
| Performance Metric | Before (40 Extensions) | After (20 Extensions) | Improvement |
|---|---|---|---|
| extensions registered | 2104 ms | 1548 ms | 26% Faster |
| workbench ready | 1130 ms | 961 ms | 15% Faster |
| register extensions & spawn extension host | 780 ms | 495 ms | 37% Faster |
My editor didn't just start quicker; it felt more responsive overall. This single step is the highest-return-on-investment action you can take.
Phase 2: Taming the File System Watcher
After dealing with extensions, the next biggest win comes from controlling VSCode's insatiable file watcher. This service is essential, but it doesn't need to watch every single file in your project.
The files.watcherExclude Power Setting
This setting is your best friend. It tells VSCode to stop wasting resources watching folders that change often but don't affect your core development work.
Here’s the configuration I dropped into my settings.json that made a massive difference in CPU and memory usage:
json
{
"files.watcherExclude": {
".git/objects": true,
".git/subtree-cache": true,
"node_modules/*": true,
"dist": true,
"build": true,
".vscode": true,
"coverage": true,
"__generated__": true,
"tmp": true,
".cache": true
}
}
What this does: It specifically ignores all the chaos inside node_modules, your build outputs (dist, build), Git internals, and other cache directories. These folders are updated by package managers and build tools, not by you directly, so there's no need for VSCode to exhaust itself watching them.
Bonus Cleanup: files.exclude and search.exclude
While you're at it, let's clean up your sidebar and speed up searches.
files.exclude: Hides files and folders from the explorer sidebar. This doesn't save a ton of performance, but it makes your project tree much cleaner.search.exclude: This one does improve performance. It prevents VSCode from indexing and searching through thousands of irrelevant files innode_modulesand other build directories, making the search feature incredibly fast.
My configuration:
json
{
"files.exclude": {
".git": true,
".DS_Store": true,
"node_modules": true,
"__pycache__": true,
".next": true,
"dist": true,
"build": true
},
"search.exclude": {
"node_modules": true,
"bower_components": true,
".code-search": true,
"dist": true,
"build": true,
".next": true,
"coverage": true
}
}
Phase 3: Optimizing Your TypeScript Engine
If you're a TypeScript developer, the language server can be a silent resource drain. Here’s how to make it more efficient.
Supercharge Your tsconfig.json
The first place to look is your project's tsconfig.json. Proper configuration here helps the TypeScript compiler (and by extension, VSCode) avoid unnecessary work.
json
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": [
"src/"
],
"exclude": [
"node_modules",
"dist",
"build",
".spec.ts",
".test.ts",
"coverage"
]
}
The skipLibCheck: true option is particularly important. It skips type checking of declaration files in node_modules, which can drastically reduce compilation and analysis time.
VSCode-Specific TypeScript Settings
Next, add these performance-focused settings to your VSCode settings.json:
json
{
"typescript.tsserver.log": "off",
"typescript.disableAutomaticTypeAcquisition": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": false
}
"typescript.tsserver.log": "off": Stops the internal log output, saving disk I/O."typescript.disableAutomaticTypeAcquisition": true: Prevents VSCode from automatically trying to download type definitions for yournode_modules, a process that can be slow and unpredictable."typescript.tsserver.experimental.enableProjectDiagnostics": false: Reduces the diagnostic load, which is helpful in very large projects.
The Nuclear Option: Clearing the TypeScript Cache
Sometimes, the TypeScript language server's cache can get corrupted or bloated. Clearing it can resolve strange performance issues and high memory usage.
- Windows:
C:\\Users\\<YourUsername>\\AppData\\Local\\Microsoft\\TypeScript - macOS:
~/Library/Caches/Microsoft/TypeScript - Linux:
~/.cache/typescript
A word of caution: This is not an official procedure, so do it at your own risk. However, in my experience, deleting these folders is safe and often has a "clearing the cobwebs" effect, making things snappier.
Phase 4: Streamlining the User Interface
VSCode's UI is feature-rich, but you don't need all those pixels rendered. Disabling UI elements you don't use can free up rendering resources, making the editor feel smoother.
Here are my preferred UI optimizations:
json
{
"editor.minimap.enabled": false,
"breadcrumbs.enabled": false,
"editor.codeLens": false,
"workbench.activityBar.visible": false,
"window.menuBarVisibility": "toggle"
}
I found the minimap to be a particular resource drain for larger files. Turning it off was an instant win. Similarly, CodeLens (those actionable links like references and implementations above your functions) can be expensive to compute and render.
Phase 5: Fine-Tuning Automatic Behaviors
Automation is great until it gets in the way.
Auto-Save and Formatting
Aggressive auto-save and formatting can cause micro-lag as you type. I found a sweet spot with these settings:
json
{
"files.autoSave": "onFocusChange",
"files.autoSaveDelay": 1000,
"editor.formatOnSave": true,
"editor.formatOnType": false,
"editor.formatOnPaste": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
This saves only when I switch away from the current file, and it formats only on save not on every keystroke or paste. This prevents the formatter from constantly running in the background as I'm trying to think and type.
Git Integration
VSCode's Git integration is convenient, but its constant polling can be a drain.
json
{
"git.enabled": true,
"git.autorefresh": false,
"git.autofetch": false,
"git.decorations.enabled": false
}
This keeps Git enabled but turns off the automatic refreshing and fetching. You can always manually fetch and refresh when you need to. Disabling decorations (the colored lines in the sidebar) also saves a bit of rendering overhead.
Putting It All Together: The Ultimate settings.json
Alright, let's consolidate everything. Here is the complete, annotated settings.json that forms the backbone of my 10x faster VSCode experience. This is the "one copy-paste to rule them all."
json
{
// ===== FILE WATCHING EXCLUSIONS (CPU & Memory Saver) =====
"files.watcherExclude": {
".git/objects": true,
".git/subtree-cache": true,
"node_modules/*": true,
"dist": true,
"build": true,
".vscode": true,
"coverage": true,
"__generated__": true
},
// ===== CLEAN UP EXPLORER SIDEBAR =====
"files.exclude": {
".git": true,
".DS_Store": true,
"node_modules": true,
"dist": true,
"build": true
},
// ===== SUPERCHARGE SEARCH PERFORMANCE =====
"search.exclude": {
"node_modules": true,
"dist": true,
"build": true,
".next": true,
"coverage": true
},
// ===== TYPESCRIPT OPTIMIZATIONS =====
"typescript.tsserver.log": "off",
"typescript.disableAutomaticTypeAcquisition": true,
// ===== UI LIGHTWEIGHT MODE =====
"editor.minimap.enabled": false,
"breadcrumbs.enabled": false,
"editor.codeLens": false,
// ===== SMART AUTO-SAVE & FORMAT =====
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"editor.formatOnType": false,
"editor.formatOnPaste": false,
// ===== EFFICIENT GIT INTEGRATION =====
"git.autorefresh": false,
"git.autofetch": false,
"git.decorations.enabled": false,
// ===== HANDLE LARGE FILES =====
"files.maxMemoryForLargeFilesMB": 4096
}
Advanced Diagnostics and Final Thoughts
If you've applied all these settings and are still curious, VSCode has one more powerful tool.
- Run
Developer: Startup Performancefrom the Command Palette.
This gives you a detailed, millisecond-by-millisecond breakdown of what's happening during VSCode's startup. It's fantastic for pinpointing any final, stubborn bottlenecks.
A Holistic Approach to Performance
Optimizing VSCode is a fantastic step, but remember that a slow development environment can have many sources. Just as we've streamlined our code editor, it pays to use tools that streamline other parts of our workflow. This is why I integrated Apidog into my process. Managing APIs can be a huge time-sink if your tools are slow or disconnected. Having a fast, all-in-one solution for designing, debugging, and testing APIs complements a high-performance coding environment perfectly, keeping the entire development loop tight and efficient.
In conclusion, a fast VSCode isn't about magic. It's about intentionality. It's about understanding the trade-offs of the tools and extensions we use and making conscious choices. By taking control of your extensions, taming the file watcher, optimizing TypeScript, and streamlining the UI, you can absolutely achieve that "10x faster" feeling.
So, what are you waiting for? Open up your VSCode settings and start your own optimization journey. Your CPU (and your sanity) will thank you.



