Hacker News new | ask | show | jobs
by stewartmcgown 1097 days ago
VSCode was essentially unusable for me on large projects. We're talking thousands of source files and god knows how many node_modules entries. Things like Go to Definition would regularly take 15+ seconds! Switched to WebStorm recently and have been very happy with the performance.
5 comments

it's quite likely that your issue is with the actual node_modules directory being referenced as part of your source. It slows the LSP too.

Exclude it (via https://code.visualstudio.com/docs/getstarted/settings) by using

  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/Thumbs.db": true,
    "**/node_modules" : true
  }
I've not had any issues with speed ever since i started excluding directories that contain junk stuff that you know you will not ever need to see in a project's view.
If you have large files (as in hundreds of MB or bigger) in your project directory, especially text files, it also really pays off to put them into either your .gitignore or the files.exclude.

Often happens to me when I run projects that output large CSVs, and it's a very notable performance impact.

Today I worked with not-so-large project: 255 typescript files, 26K LoC, 920 modules in node_modules, 29351 js/ts files total (with node_modules), 4.5M LoC total. I just checked and go to definition works pretty much instantly.

Anyway go to definition is a function of LSP server, AFAIU. I understand that it's bundled with vscode and feels like a single product, but still I'd separate vscode and LSP servers and judge them differently.

>We're talking thousands of source files and god knows how many node_modules entries.

I think most VSCode features are disabled for node_modules directories by default.

At a guess, I'd say re-disabling that in your workspace file would resolve all of your performance issues. For even simple projects you'd be including hundreds of MB of text files, and thousands of subdirectories.

They are indeed -- and it will avoid similarly costly stuff on anything you .gitignore.
Weird, i often opened files with hundreds of thousands of code lines without any problem. We do have very modern Workstations at work though.
VS Code has stopped opening for me for certain codebases. And to be honest, these codebases aren't even that large.

I also have 0 extensions installed :(

VS Code used to be my quick and dirty IDE when I didn't want to open something heavier, but it's gotten so much more painful than even a couple of years ago.