3 ms·
“Does the Javascript language inherently result in a bloat runtime?“ No “Are the runtimes accidentally bloat?” Not accidentally “Is it all the browser stuff
by 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.