3 ms·
The memory issue with Electron is the DOM, not the Javascript. Reducing V8's memory isn't going to help much.
by realusername 7y ago
The memory issue with Electron is the DOM, not the Javascript. Reducing V8's memory isn't going to help much.
- derefr 7y agoWhat is it about the JS DOM that makes a DOM of N elements modelling a given app’s view, have a higher memory footprint than the “DOM” (view state) of a native graphics toolkit modelling an equivalent app’s view?
- smolder 7y agoPart of it is just how feature complete browser compositing is. The other part is bloat due to how it was all implemented. HTML and CSS were never optimal representation for complex documents, and a ton of features have been added on top.
- arc33 7y agoCan't we compile those things out of the engine when using it for the desktop?
- coldtea 7y ago>What is it about the JS DOM that makes a DOM of N elements modelling a given app’s view, have a higher memory footprint than the “DOM” (view state) of a native graphics toolkit modelling an equivalent app’s view? For starters, because the DOM is a very inefficient design of an app's view, primarily designed for text and simple forms, and with all kinds of extra crap bolted on. Until CSS Grid, there wasn't even a proper layout engine available, and people used styling primitives meant to float text for UI design... A native UI engine can implement drawing a window with a button (the raw widgets, design wise) with a few lines of code to draw, two rectangles, some edge shading, and some text. The DOM has thousands of lines for all kinds of contingencies for the same thing...