3 ms·
>Why would an "embedded browser engine" be any better? Electron after all is also a browser engine, and that's what makes it slow and bloated compared to native
by rafaelmn 2y ago
>Why would an "embedded browser engine" be any better? Electron after all is also a browser engine, and that's what makes it slow and bloated compared to native UI, not the embedded part (by which I asume you mean something like a browser engine wrapper widget).
There are legacy parts of browser layout that make it impossible(?) to optimize some rendering while being standards compatible. If you just chose a subset that is fast to implement and focused on being subset you narrow the scope of the project and enable optimizations.
Electron has to implement everything chrome has to support even though the apps running in it will never touch it.
Also web engines have to be heavily sandboxed because you cannot allow internet code break out of the sandbox.
Native apps shipped with electron already ship Node and just waste resources sandboxing stuff with security layers.
- coldtea 2y ago>There are legacy parts of browser layout that make it impossible(?) to optimize some rendering while being standards compatible. If you just chose a subset that is fast to implement and focused on being subset you narrow the scope of the project and enable optimizations. Embedded browser engines though are either wrappers for Webkit and Blink (thus also including the "legacy parts of browser layout that make it impossible(?) to optimize some rendering") OR simplistic web rendering engines that are not as capable as Chrome/Webkit for layout and not compatible with all modern CSS/HTML features.
- rafaelmn 2y agoBut that is where servo can fill the niche, focus on modern/fast parts, ignore legacy compatibility.
- viraptor 2y agoTo be fair, there's lots that could be stripped from chrome bundled with electron. Nobody's really attempted that yet as far as I can tell - but I really hope we'll get there. I mean, there's hundreds of compilation options in there, for components that will never be used by a simple app. Does your desktop app need a gyro, webrtc and gamepad support? But they're loaded anyway.
- RussianCow 2y ago> Does your desktop app need a gyro, webrtc and gamepad support? I doubt those impose very much (if any) overhead for just being present but unused. In any case, those aren't the things that the OP was talking about; there are plenty of layout-related standards like floats that are almost never used in modern web apps yet inhibit or prevent many optimizations that could potentially significantly increase rendering performance. For a more extreme example, imagine how much faster layout rendering could be if you removed all types of layout other than grid—you'd be able to remove a bunch of checks and all the code that handles edge cases, significantly simplifying the happy path. Nobody (to my knowledge) has done this because it's not as simple as forking Chromium and removing code. Without the mentioned optimizations, I don't think you'd see much benefit.