WebStorm indexing node_modules is the #1 CPU killer. Create React App projects have 230,000+ files in dependencies. WebStorm tries to parse every single TypeScript definition file, every README, every package.json - pure insanity.
After excluding node_modules, WebStorm will still index 10,000+ files, but at least it won't parse 300,000 dependency files you'll never edit. CPU usage drops instantly. You lose autocomplete for some third-party libs, but seriously - when's the last time you needed IntelliSense for `lodash`? Use the documentation.
The JVM Performance Nuclear Option
WebStorm runs on the JVM, which means garbage collection pauses can freeze your editor for 5-10 seconds. The G1 garbage collector handles large heaps better than the default ParallelGC:
- Help → Edit Custom VM Options
- Add these lines:
-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
-XX:G1HeapRegionSize=32m
-XX:+UnlockExperimentalVMOptions
-XX:+UseJVMCICompiler
- Restart WebStorm
GC pauses drop from 8 seconds to under 1 second. The JVMCI compiler makes JetBrains' code run faster too. Learned this debugging memory leaks in IntelliJ IDEA - same JVM, same problems, same solutions.
Platform-Specific Performance Hacks
macOS: Disable Spotlight indexing for WebStorm directories. Spotlight and WebStorm both trying to index the same files creates I/O contention that murders SSD performance:
sudo mdutil -i off ~/WebstormProjects
Windows: Exclude WebStorm from Windows Defender real-time scanning. Every file WebStorm touches gets scanned twice - once by Windows, once by WebStorm's indexer. Pure inefficiency:
- Windows Security → Virus & threat protection → Exclusions
- Add folder:
C:\Users\[username]\WebstormProjects
- Add process:
webstorm64.exe
Linux: Use ext4 instead of btrfs for project directories. Btrfs snapshots slow down I/O on projects with massive node_modules directories. Performance difference is dramatic.
When File Watching Goes Wrong
WebStorm monitors every file for changes using native file watchers. On a React project with 50,000 files, that's 50,000 file handles. macOS ulimit defaults can't handle it:
ulimit -n 65536
Add to your shell profile (.zshrc/.bashrc) permanently. WebStorm will throw `Too many open files` without this, especially on projects using npm workspaces or monorepos.