
Ask HN: What technical decisions make VS Code a better Electron app? - ValentineC
I was inspired by the recent article on how Slack (which is built with Electron) is a RAM hog, but I&#x27;ve always wondered how things were done differently when compared to Atom too.
======
akmittal
1\. They are doing things lazily. Like only render(and check for errors) the
part which is inside viewport first.

2\. They are not creating layers of JavaScript. They are using native code
wherever necessary.

3\. VS code has more control over what extensions can do so that they don't
adversely affect the performance.

~~~
pitaj
I'm not sure where you're looking, but as far as I can tell, VS Code uses
practically zero native code. When looking to the git repository, all I see is
TS, JS, CSS, and some misc stuff.

~~~
jplatte
I know they use ripgrep¹ for their project-wide search feature. I'd imagine
that the other native code would also be separate processes whose output is
parsed, or in C / C++ / Rust libraries that live in their own repos and that
they use via bindings which would themselves only be JS / TS code (and might
live in separate repos as well).

¹:
[https://github.com/BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep)

------
nimish
They used good engineers and a major part of the spec was that speed matters
and is the ultimate feature. So when they used the Monaco component the
engineers behind it made sure to prioritize speed and efficiency (it didn't
hurt that they could rely on microsofts years of dev tool experience)

Technically they didn't do anything insane, the real trick is to measure test
and improve metrics they care about and not let it become slow.

------
type0
It's based on [https://github.com/Microsoft/monaco-
editor](https://github.com/Microsoft/monaco-editor)

But there's also another promising project that uses monaco
[https://github.com/theia-ide/theia](https://github.com/theia-ide/theia)

------
samblr
Vs code had its share of performance problem. A while ago there was a hog
caused by blinking cursor in editor.

~~~
roryisok
I got downvoted for saying this last time but I think that was only on mac

------
wodenokoto
While we are at it, can we compare those approaches to native web app with
that of R-studio?

I was quite surprised to see the right-click menu item "inspect element" open
up a DOM-inspector of the entire app! I had not suspected it to be like that.

------
dsschnau
On that note, I haven't heard much about Atom in a long time. Is anyone still
using it?

~~~
ezekg
A couple weeks ago I switched from Atom to VS Code due to the abysmal
performance of Atom. I wish I had switched earlier.

~~~
w4tson
I find both sluggish compared to sublime text. I flipping love that tool.

~~~
roryisok
Sublime is definitely the king of start times. Vscode feels like more like a
full IDE though

------
samueldavid
I think it all comes down to the developers abd how they optimize their
codebase

