Hacker News new | ask | show | jobs
by vbezhenar 1098 days ago
That's surprising to hear, because I use vscode every day and its performance is miles away of any JS apps I've ever used. It truly feels like a native app when it comes to performance, at the same time keeping some "fluidity" of web app (like scale the entire UI with single key press or reloading the entire app like a web page).

I'd say I never had issues with vscode performance and actually its performance is a major factor why I use it.

4 comments

It's better than other Electron programs (a low bar, since most of those perform shockingly poorly) but eats way more system resources and performs noticeably worse than Sublime Text, on my machine.
Oh noes, who could’ve thought that application written in JavaScript that gets executed on browser engine is slower than lean C++ that uses their own custom GUI toolkit http://news.ycombinator.com/item?id=2822114.
Sublime text is an editor, VS Code is an IDE, though?

The featuresets aren't the same.

I'd say they compete in a similar space of smart plugin-friendly code editor, not IDE.

What are you thinking of, in terms of differences? I use both quite a bit (some of VSCode's plugins are better) and have always viewed them as very close to one another, in terms of features.

For one thing VS Code has a full debugger with breakpoints and stack analysis that supports many backends out of the box, that's an IDE feature.

Sublime doesn't have any (real) debugger even with plugins. Some attempt to tack on a debugger but they have to do so via popup menus or overloaded "magical" text buffers and it's atrocious. Why can't I click on the line I want to break on? Why can't I see the stack in a nice editable tree? Right, because sublime is a text editor and VS Code is an IDE.

Ah—I'd never noticed VSCode could do that, in years of using it. I ignore some of its features (some of which Sublime also has, and I tend to ignore them there, too) because I find them janky and fragile or requiring-configuration such that I lose a lot of time keeping them happy, like any kind of run-from-editor stuff and the built-in terminal (it always seems to have a messed-up environment or get itself into broken states) dropping to a separate terminal for that sort of thing. Not like when I'm, say, working in XCode or Intellij and almost exclusively run, build, & debug from inside the IDE, rarely touching a separate terminal.

Guess you've got a point, then, and I just don't use it that way.

For the most part I agree with you but "miles away of any JS apps" is a low bar to cross.
I use vs code and jet brains intellij. Vscode is by miles more stable and light weight for running a java spring app. Of course intellij runs a lot of stuff but the experience is not better for it. Intellij feels like a sloth next to vscode
IntelliJ is not very fast by any benchmark. I mean it's based on Swing! There's a pronounced multi-frame pause between right clicking and seeing a context menu.

C++ based editors like Kate blow both VSC and IJ out of the water. Runs so fast it feels janky, like the computer isn't doing anything.

I haven't heard of Kate. I'll try it out
It's from the KDE project, and while it's portable, but I can't speak for how well it looks on other platforms.
It also does maybe a quarter of what IDEA can do. Let's see how it performs when it catches up to what IDEA does right now (maybe in another ten years).
It does everything I need to run to do my job. If intellij is doing more stuff that is slowing it down then maybe they can find a better performance-feature trade off by getting rid of the bloat
It would turn into another run of the mill text editor like VSCode then, and would lose most of its users.
Vs code is not a run of the mill editor though. It can be configured to support all useful features of intellij. Even then it's faster than intellij
Yeah this sounds like a misconfiguration. We've already forgotten that native apps tend to require a bit more fine control on how they use resources, all in the name of the cult of portability.
How do I configure it right? One good thing about vs code is it works well out of the box with almost zero custom configuration
IntelliJ has a lot of legacy code, including custom re-implementation of all things UI.

And it offers vastly more features than VS Code.

Make sure you’ve got your IJ memory settings tuned right. I assign 8GB rather than the default (2?).

Also, if you’re on a Mac — there’s an Apple Silicon build that is noticeably better.

> I assign 8GB rather than the default

This is not a good argument in a thread where the central claim is that VSC is a resource hog but other IDEs aren't

Why is it that VSCode is the only good Electron app? I get that Microsoft have talented developers, but so does other companies, yet VSCode remain the single application that shows that Electron apps can work.
Even though it is based on web tech and Electron, VSCode cares about performance, while garbage like Microsoft Teams does not. That's about it.
I use discord and gitkraken every day and I've never had any issues either. People just like to complain. They act as if using a few hundred megabytes for the main app you are using is an issue. It's not the 90s anymore ram is cheap, especially at those amount.
Why is it better to have a million people buy more RAM, creating a large amount of electronic waste and emissions, instead of putting some effort into not unnecessarily wasting resources?
You don't need to buy more ram. It was already cheap a decade ago. Ram has been in the multiple gigabyte range for longer than that. Having an app that you use all the time every day use a few hundred of the otherwise unused ram is perfectly reasonable.
> It's not the 90s anymore ram is cheap, especially at those amount.

I just wrote the exact same thing in another comment.

That's what the problem is ... it's the old timers complaining that things aren't native, thus they are RAM hogs and are slow by default. Even if they are fast, they are "slow and bloated" just because it's the gut reaction when you have layers on layers of other stuff over native code.

And I'm an old timer but I am not complaining. I love VS Code and I think it's blazing fast for what I need it for, a large Angular enterprise application.

Or maybe you're just fine with throwing away thousands of dollars at it every few years, so you're not seeing the problem. The "solution" that most of the world simply cannot afford.
If I could roll my eyes any harder, they’d be spinning.

99.9% of people who complain about electron apps are not ardent defenders of third world computing. It just violates their sensibilities.

I am not one of those "99.9%" (seems like a random number pulled out of someone's ass). Most developers in my poor country don't make much and would quality as lower-middle class in yours. Including a good friend of mine, who is learning web development on a 10-year old laptop — he can't afford anything else. I know he struggles with VSC because I hear about it daily.
Of cut it off with most of the world bullshit, we’re talking about development tool here, not solving world hunger.
There are no developers outside Silicon Valley, got it.
People act as if their precious app is the only one a user is going to run and has the right to hog all the memory and CPU.
> Why is it that VSCode is the only good Electron app?

Because you need to sink hundreds of thousands of man-hours into making it work.

And fight against web tech most of the time you're doing that.

Also, Figma.
I think WebAssembly might play a role there. https://twitter.com/mattrickard/status/1410714002456383490
Obsidian also
What CPU do you have? Because even though VSCode is "just" a text editor, I've found it's relatively demanding. A Core 2 Duo, which is admittedly a little old, but which does absolutely fine with vim, is slow to the point of being unusable with VSCode.
I think unfortunately a CPU from 2008 just isn't gonna cut it here. Single thread benchmarks core for core have risen about 4x since then, average core counts have risen 4x, and L3 caches were added. Probably SIMD instructions are a consideration here as well.

That being said I'm a huge fan of prioritizing longevity of computer parts versus constantly upgrading and generating e-waste.

I used to run vim and VS Code on a Core 2 Duo from 2005. Vim is a lot faster but VS Code is so much more powerful — it’s a full featured IDE. It’s not a quick and dirty text editor like Kate. It’s not meant to be that. I still use vim to edit config files but for everything else I use VS Code.

I’ve since upgraded to a 2014 i7 and now VS Code feels fast.

Kate is not a "quick and dirty text editor" either? Kate has session and project support (admittedly a bit more clunky than VSCode, but it works), good LSP support, decent built-in search, GDB integration, a built-in terminal, Git integration, etc. Sure, it may be less polished than VSCode in some of these aspects, but they're there and mostly just work.
I use VSCode NeoVim and clangd. This has gotten so good, although command mode took awhile, that I rarely need to use a terminal vim.
I’ll bet a lot of this whole argument is just windows v mac. VS code is snappy on Mac, much less so on my windows machine.
Apple M1 Max.

I understand that everyone's situation is different, but I live in a poor country, making like $2k/month and still consider investments into my computer worthwhile, so I never tried to save money on it. This is american website, so most people here surely can afford fast computer for their work.

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.
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.