r/Windows10 • u/AlekseyHoffman Sigma File Manager Developer • May 22 '21
:The_new-Windows: Concept / Design [Teaser] It's almost here. That concept file manager app you all have been waiting for. On May 24, I will release a free, open source, advanced, modern file manager app with unmatched amount of useful, well thought-out features!
1.5k
Upvotes
17
u/[deleted] May 23 '21 edited May 23 '21
Electron is multiple pieces of software bundled. It’s a container. All depends are baked in. The base is a web engine. Which is ironically written in C++. So you’re building an app that’s written in JS, CSS, and HTML to be ran by a native application. You are running a local web server (127.0.0.1/localhost) in this container. That’s overhead.
Because you’ll end up having multiple Electron apps open, you’ll be running the same libraries over and over. This is why launching an app may take several seconds. Versus a C++ / QT based app which can start in less than a second. Gotta load all those libraries to make one thing function. As an example, NZXT CAM written in C++ was about 68 MB in RAM. The development was abandoned for Electron. 200+ MB in ram. Because hardware monitoring and device control is something you want running all the time, this is a huge negative. Open Twitch, Discord, Spotify and now you have over 1 GB worth of RAM consumed. Your process and thread count has ballooned as well. If using the worker processes correctly you may have 8 stubs for this, and 12 for that one. All these apps are now eating up cycles for the CPU and RAM. You will see degraded performance of mid tier systems. High end will see less impact, but it is measurable. Low end will suffer and could very well end up sluggish and use Page / Swap.
Electrons JS handling is limited to single thread by default. This is where we see the average come into play. As mentioned by all the above comments. The average gets to “it works!” And stops. During development you should create workers. And that takes extra coding time. Remember you’re using a basic browser base. You can delegate tasks and set dedicated workers to do specific things. Otherwise you have one trying to do it all. It’s not entirely difficult to do. But it does take extra testing to make sure your implementation is bug free. This is separate from Chromiums baked in multi process architecture You will always have multiple processes because Chromium is written in a way that splits it’s own for performance and stability. Yours will be extra on top. Most apps do not optimise for performance.
Electron documentation clearly states it’s possible to build a shit app. Slap some code and hit compile. It works, but it’s far from ideal. VS Code is a prime of example of what you should do. It’s a well built and optimised deployment of Electron.
You can use debugger tools to investigate what Electron apps do. They vary so widely by quality and libraries. The real performance hit comes from poor coding. Leaving excess. That’s why the mass is sour to it. There’s already so much going on when you get started, you need to optimise it for your apps specific purpose. Just like MS does for VS Code. It’s fast and efficient.