4 ms·
It may be too obvious, but something you can do that a staggering number of electron/CEF/etc devs don’t is to write highly efficient JavaScript. This leads to c
by kitsunesoba 8y ago
It may be too obvious, but something you can do that a staggering number of electron/CEF/etc devs don’t is to write highly efficient JavaScript. This leads to craziness like the desktop Spotify client eating nearly a whole gigabyte of memory after browsing albums and artists for a minute or two, which is by no means necessary.
Make performance a high priority, don’t just stop once it’s working.
- mosdl 8y agoThis is often because they use a bunch of third party software that adds a lot of bloat. For example Firefox devtools uses redux and you can notice the perf issues. Another issue is many js devs don't know how the Jit compilers work. Using classes is usually more efficient than plain js objects if you are doing a lot of mutations.
- imtringued 8y agoI remember there being a bug in chrome which causes it to keep loaded images in memory forever, this can cause RAM usage to grow into the gigabytes range but this only affected electron applications. Additionally in a code base as big as chrome it wouldn't surprise me if there are thousands of tiny variants of those bugs that leak a few 100KB of RAM here and there which then add up to 100MB or more even in a sufficiently optimized application. I think the fundamental problem is that chrome just wasn't built to host a single application that never refreshes. It's optimized for opening dozens of websites and cleaning up resources in between page loads. This requires a certain amount of memory no matter what you do. In terms of rendering performance there aren't any significant problems if the DOM manipulation is done correctly. It shouldn't be any slower than say Qt assuming properly written JavaScript. I'm sure a solution can be found to solve those problems. However the sad truth is that no one who chooses electron cares about any of that and would rather point out how cheap RAM is and that you could solve this problem by spending 60€ on another 8GB of RAM.
- Siilwyn 8y agoGot you: http://seenaburns.com/debugging-electron-memory-usage/ http://seenaburns.com/debugging-electron-memory-usage/