Ask HN: What technical decisions make VS Code a better Electron app?
I was inspired by the recent article on how Slack (which is built with Electron) is a RAM hog, but I've always wondered how things were done differently when compared to Atom too.
15 comments
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.
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.
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.
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
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.
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.
It's based on https://github.com/Microsoft/monaco-editor
But there's also another promising project that uses monaco https://github.com/theia-ide/theia
But there's also another promising project that uses monaco https://github.com/theia-ide/theia
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.
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.
[deleted]
On that note, I haven't heard much about Atom in a long time. Is anyone still using it?
Everyone at my company uses it with Nuclide, which still seems to be the best IDE combo for codebases that use Flow.
A couple weeks ago I switched from Atom to VS Code due to the abysmal performance of Atom. I wish I had switched earlier.
I think it all comes down to the developers abd how they optimize their codebase