benji shine

View Original

VSCode performance fix for Mac OS X Sierra

I recently started using VSCode for my Ember development, and I like a lot about it... except, it was slow! I'd been using JetBrains IDEs for years, first RubyMine and then WebStorm, and I wanted to try something new & shiny. (I like shiny things.)

When I ran Ember, Chrome, and VSCode together, horrible things happened. My CPU spiked and my computer crawled. From experience with Sublime and WebStorm, I suspected it was watching too many files. I found a setting that should have helped, but didn't help enough, and then another setting that fixed the problem entirely!

The new special setting is files.watcherExclude. Apparently just files.exclude isn't a strong enough signal that VSCode should really, truly ignore those files.

"files.watcherExclude": {
        "**/.git/objects/**": true,
        "**/.git/subtree-cache/**": true,
        "**/node_modules/*/**": true,
        "**/dist/**": true,
        "**/tmp/**": true
      },
  "files.exclude": {
        "**/.git/objects/**": true,
        "**/.git/subtree-cache/**": true,
        "**/node_modules/*/**": true,
        "**/dist/**": true,
        "**/tmp/**": true
      },

All of the IDEs I've used have required some tuning of this sort. With the JetBrains IDEs, we just have to configure the JVM properties, and the internet knows that pretty well... but I haven't found this fix for vscode mentioned anywhere yet. I hope it helps.