Sublime Forum

ST3 Consumes much more memory than VSCode

#1

Hello,

I just purchased a new license as I am in need of a fast editor that consumes very little memory. My editor of choice thus far has been VSCode and thought I’d give ST3 a try as it is not an electron app and everyone says it should be magnitudes faster.

I have NOT added any add-ons, plugins or any other customizations on either editor and opened the same folder/files in both editors for comparison. Please see below screenshots from my activity monitor:

If anyone is able to guide me in understanding why this may be, I would greatly appreciate it.

Thanks,

0 Likes

#2

Notice all those “Code Helper” lines? You have to sum all their CPU/RAM/etc. usage for a fair comparison to the one line that Sublime takes. Use the “Search” box in the top right and type “Code” into it.

3 Likes

#3

Just as @michaelblyons mentioned, Code has several additional processes that are used for its core app in comparison to ST single process.

1 Like

#4

To be fair: my perception is that VSC has gotten better than it used to be, but I currently have one project open in VSC, and six open in ST, which is using roughly the same RAM.

1 Like

#5

Thanks @michaelblyons and @TheSecEng for your responses.

I did not know about the additional processes used by Code.

Once I have accounted for these the usage is about the same for both editors. Is this the norm?

From my research on stackoverflow and other forums ST3 was to consume far less memory than Code.

0 Likes

#6

If you go into the menu: View>All Processes, Hierarchically, you can see which processes VSCode and ST launch.

An important thing to note is that within reason Sublime Text focuses more on performance than memory optimization. A good example of this is that chrome can use a compacting garbage collector with Javascript, ensuring that most of the used memory is in one contiguous block, whereas Sublime Text is mostly manually memory managed. This can lead to memory fragmentation, causing higher memory usage than necessarily required, but completely avoid garbage collection pauses in the application.

4 Likes

#7

Thanks @bschaaf

That means that using memory usage alone to gauge performance does not make sense.

Also thank you for the tip on grouping processes, did not know about this feature . These were my results:

Am not really sure what to make of this as it seems code still uses less memory, so I guess I must just use Sublime Text to understand if it truly results in less overhead.

0 Likes

#8

@warriorgiggles I would suggest you use them both similarly and see your results. On my machine you can see that opening the same folders/files with the same plugins configured, VS Code consumes up to 3x as much.

1 Like

#9

Also try opening a large project with many open tabs. My guess is that the size of each buffer is also larger in VSCode (because of its web browser architecture).

0 Likes

#10

That’s right, usually optimization either focuses on memory consumption or performance, each one coming at the price of the other.

I like both ST3 and VSCode, each one has its benefits and points of strength, but definitely ST is faster, and this is something perceivable when you work with big projects.

I think that we’re going to see some changes in VSCode for Windows soon, due to MS plans to integrate Chromium natively on Win 10, and the introduction of the new Edge-based WebBrowser control. Maybe this could positively affect performance and memory in VSCode for Win 10 (but it’s just a guess).

I would expect that any Chrome-based editor should consume more memory than ST3 though, for my understanding is that Chrome is quite memory heavy overall (at least, its basic memory consumption should be quite high, although opening additional tabs and project might not have such a big impact on the base-consumption).

Also, chances are that both apps will have different memory impacts on different OSs.

@warriorgiggles, as a new ST users you shouldn’t really worry about these issues, as you’ll start to work with ST you’ll realize that it’s blazing fast, and chances are that you won’t experience memory problems unless you’re working on a netbook with limited memory, or a very old machine.

Having said that, memory fragmentation due to multiple application running simultaneously can occasionally result in ST lagging now and then (sometime I notice that ST can take a few seconds to refresh its GUI when switching focus from other running apps), but this is due to the OS, not to ST.

0 Likes

#11

You want a Formula 1 Car but it should be consume only 1 liter of gas?
I earn money with my work so I can pay for a fast computer with enough RAM. If you don’t, you do something wrong

0 Likes

#12

@tajmone and @bschaaf thanks for the responses, given me a lot to think about.

@xitara thank you for your insights on cars I guess… and congratulations on all the money!

1 Like

#13

Apparently thinks are not as good on Mac for Sublime

Because on my Windows VSCode takes 1GB with nothing open, ‘just-installed’ installation.

While my Sublime has 4 windows, 2 projects, 13 open files, 10 open non-saved files, 21 installed extensions and it’s using 219 MB.

On my Linux things are a little worse, with 310 MB with similar setup.

1 Like