4 ms·
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.
- deleted 9y ago[deleted]
- samueldavid 9y agoI think it all comes down to the developers abd how they optimize their codebase
- akmittal 9y ago1. 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 9y agoI'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 9y agoI 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 9y agoThey 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.
- wodenokoto 9y agoWhile 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 9y agoOn that note, I haven't heard much about Atom in a long time. Is anyone still using it?
- ezekg 9y agoA couple weeks ago I switched from Atom to VS Code due to the abysmal performance of Atom. I wish I had switched earlier.
- seattle_spring 9y agoEveryone at my company uses it with Nuclide, which still seems to be the best IDE combo for codebases that use Flow.
- type0 9y agoIt'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 9y agoVs code had its share of performance problem. A while ago there was a hog caused by blinking cursor in editor.
- roryisok 9y agoI got downvoted for saying this last time but I think that was only on mac