←back to thread

50 points senfiaj | 5 comments | | HN request time: 0s | source
Show context
SurceBeats ◴[] No.45809221[source]
The article is kind of right about legitimate bloat, but "premature optimization is evil" has become an excuse to stop thinking about efficiency entirely. When we choose Electron for a simple app or pull in 200 dependencies for basic tasks, we're not being pragmatic, we're creating complexity debt that often takes more time to debug than writing leaner code would have. But somehow here we are, so...
replies(7): >>45809249 #>>45809272 #>>45809432 #>>45809461 #>>45809481 #>>45809606 #>>45809909 #
rossant ◴[] No.45809249[source]
Yes. Too many people seem to forget the word "premature." This quote has been grossly misused to justify the most egregious cases of bloat and unoptimized software.
replies(1): >>45809271 #
SurceBeats ◴[] No.45809271[source]
Yeah, somehow it went from don't micro optimize loops to 500MB Electron apps are just fine actually hahaha
replies(3): >>45809389 #>>45809477 #>>45809548 #
1. stared ◴[] No.45809477[source]
I hope Tauri gets some traction (https://v2.tauri.app/). The single biggest benefit it drastically smaller build size (https://www.levminer.com/blog/tauri-vs-electron).

A 500MB Electron app can be easily a 20MB Tauri app.

replies(1): >>45809712 #
2. brabel ◴[] No.45809712[source]
Not sure. Tauri apps run on the browser and browsers are absolute memory horders. At any time my browser is by far the biggest culprit of abusing available memory. Just look at all the processes it starts, it’s insane and I’ve tried all popular browsers, they are all memory hogs.
replies(3): >>45811682 #>>45811683 #>>45811778 #
3. peterfirefly ◴[] No.45811682[source]
Electron apps also run in a browser. They package an entire browser as part of the app.
4. dspillett ◴[] No.45811683[source]
A big complaint with Electron that Tauri does avoid is that you package a specific browser with your app, ballooning the installer for every Electron app by the size of Chromium. The same with bundling NodeJS (or the equivalent backend for Tauri), but that isn't quite as weighty and the difference is which backend not whether it is there at all or not.

In either case you end up with a fresh instance of the browser (unless things have changed in Tauri since last time I looked), distinct from the one serving you generally as an actual browser, so both do have the same memory footprint in that respect. So you are right, that is an issue for both options, but IME people away from development seem more troubled by the package size than interactive RAM use. Tauri apps are likely to start faster from cold as it is loading a complete new browser for which every last byte used needs to be rad from disk, I think the average non-dev user will be more concerned about that than memory use.

There have been a couple of projects trying to be Electron, complete with NodeJS, but using the user's currently installed & default browser like Tauri, and some other that replace the back-end with something lighter-weight, even more like Tauri, but most of them are currently unmaintained, still officially alpha, or otherwise incomplete/unstable/both. Electron has the properties of being here, being stable/maintained, and being good enough until it isn't (and once it isn't, those moving off it tend to go for something else completely rather than another system very like it) - it is difficult for a newer similar projects to compete with the momentum it has when the “escape route” from it is generally to something more completely different.

5. Redster ◴[] No.45811778[source]
Based on https://v2.tauri.app/concept/architecture/, it seems that Tauri uses native webviews, which allows Tauri apps to be much smaller and less of a memory hog than a tool which uses Electron and runs a whole browser.