3 ms·
What exactly makes the average Electron program so goddamn awful? Does the Javascript language inherently result in a bloat runtime? Are the runtimes accidental
by yazzku 4y ago
What exactly makes the average Electron program so goddamn awful? Does the Javascript language inherently result in a bloat runtime? Are the runtimes accidentally bloat? Is it all the browser stuff and not the JS runtime per se? Or maybe just bad programming on the dev side?
- cultofmetatron 4y agoits a massive embedded browser. imagine if every app you opened on your computer was a separate process running chrome? thats more or less literally what electron is.
- Hackbraten 4y agoThat’s just what opening a new tab in your web browser is. Dedicated Electron-based apps are even worse than that: a separate set of processes running their own embedded version of Chrome.
- fwlr 4y ago“Does the Javascript language inherently result in a bloat runtime?“ No “Are the runtimes accidentally bloat?” Not accidentally “Is it all the browser stuff and not the JS runtime per se?” Basically, yes “Or maybe just bad programming on the dev side?” No Essentially the reason Electron apps are so heavy is they run on a browser, not on an operating system. In the beginning, programs ran directly on hardware, and things were good. (e.g. Pretty much every game would ship with a custom bootloader that knew how to address the hardware and exposed this to the program, you didn’t - couldn’t - have anything else running at the same time.) Later on, programs ran on the operating system, and things were okay. Operating systems abstracted over all the possible hardware configurations in an acceptable way and users got the benefit of running multiple programs simultaneously without too much of a performance cost. Now, programs run on the browser, itself a program running on the operating system. Because the browser wants to be a platform for any other program, it has to hook into almost every part of the operating system, so that it can support almost any program. This necessarily brings with it enormous bloat - in effect you’re running one general-purpose pseudo-OS framework per program. At places I’ve worked there have been discussions about whether to use Electron. Something one dissenter said has stuck with me. “Imagine every Python module you imported ran in its own Docker container. You would quit, but that’s what we’re asking of users.”
- holoduke 4y agoBrowser performance is actually very good. Its runtime js engine is heavily optimized. Same for the render. Wether its the dom node render or canvas one. They can be very fast. Certainly possible to write native like apps. The problem are those libs . In this case electron. There are a zillion parsers and inefficient steps in every app code execution path i see.
- SomeoneOnTheWeb 4y agoMainly the fact you have to run an entire browser (= more memory usage, slower startup time) and that it runs on HTML + JS, which is very slow compared to fully-compiled languages like C, C++ or Rust.