r/FlutterDev • • Oct 12 '21

Article Desktop performance deep dive: Flutter vs Electron

https://getstream.io/blog/flutter-desktop-vs-electron/
130 Upvotes

57 comments sorted by

39

u/[deleted] Oct 12 '21

It's nice to finally see some numbers. It's no surprise that Flutter is more efficient than Electron, but for some use cases the difference was huge (2.2 GB Electron vs 170 MB Flutter).

32

u/xopranaut Oct 12 '21 edited Jul 02 '23

I am the man who has seen affliction under the rod of his wrath; he has driven and brought me into darkness without any light; surely against me he turns his hand again and again the whole day long. (Lamentations: hgemlry)

14

u/effeje Oct 12 '21

intellij platform is pretty competent.

12

u/TonyBorchert100 Oct 12 '21

Did I miss something?

IntelliJ was not written by google, nor is it written in Dart/Flutter

2

u/xopranaut Oct 12 '21 edited Jul 02 '23

I am the man who has seen affliction under the rod of his wrath; he has driven and brought me into darkness without any light; surely against me he turns his hand again and again the whole day long. (Lamentations: hgeorot)

11

u/effeje Oct 12 '21

it's not the best, nor is vscode or visual studio, all have shortcomings, but from my understanding intellij platform is the most accesibile solution to create your ide. yeah sure Google has the money to build it from scratch, but will they do it?

4

u/xopranaut Oct 12 '21 edited Jun 30 '23

PREMIUM CONTENT. PLEASE UPGRADE. CODE hgeppux

7

u/HaMMeReD Oct 12 '21

Pretty sure I heard this complaint about flutter about 5,000x now, but we are approaching on year 3 of production flutter, and many years of development work before that.

VsCode itself works exceptional for most flutter development, but you do see google dogfooding flutter and using it for a huge amount of developer tools/integrations in the ecosystem.

Google doesn't abandon everything, but they do fail fast when something doesn't pan out, generally.

2

u/xopranaut Oct 12 '21 edited Jul 02 '23

He has made my flesh and my skin waste away; he has broken my bones; he has besieged and enveloped me with bitterness and tribulation; he has made me dwell in darkness like the dead of long ago. (Lamentations: hgesgk8)

-1

u/FormerGameDev Oct 13 '21

by fast you mean "puts many years into it, then just dumps it"

0

u/[deleted] Oct 13 '21

[deleted]

0

u/FormerGameDev Oct 13 '21

Totally agree, just Google seems to do the opposite of "fail fast", and just cancels really good and successful things out of the blue (Reader), or dumps insane amounts of time into things for years and then drops them with a year long warning (Plus), or barely supports really good things, keeping them barely on life support, and occasionally throwing a new skin on them to make it look like they're doing something (Voice).

→ More replies (0)

14

u/themightychris Oct 12 '21

we already saw Google choose to build Android Studio on top of intellij instead of build their own

Let's be honest, how many developers would jump to a new IDE that only competes with vscode in memory usage (but is behind in all the things that expand with adoption)

I would like it to exist as it will make development more accessible to less privileged people, but no one is going to do it for commercial reasons as RAM is cheap enough for the people they care about

1

u/FormerGameDev Oct 13 '21

VS Code is really quite new, though.

1

u/Flaky-Illustrator-52 Oct 13 '21

It's basically copying the idea of emacs but making it prettier and more resource-intensive

3

u/FormerGameDev Oct 13 '21

which i guess copied the idea of 'ed' and whatever came before that.

i'm just saying that VS Code is quite new as an editor, and has taken over a LOT of mindshare, even from VS itself, and that's quite an accomplishment in a relatively short time. The editor I used before VSC (Komodo) had been around for probably 15 years before I switched, and I'd been using it quite a long time at that point.

Just saying, it doesn't have to be behind for very long.

1

u/[deleted] Jul 17 '22

Well it has better usability and it is arguably easier to install and use plugins.

1

u/Zalenka Oct 13 '21

And it's java, which is likely quite efficient.

If only Java had great compelling UI libraries. Instead big companies like Microsoft just went javascript with bloated junk.

1

u/Auxx Oct 13 '21

JavaFX is great, but Oracle doesn't care much about it.

1

u/AcridWings_11465 Sep 04 '22

Which is why we have Compose desktop now

3

u/David_Owens Oct 13 '21

An open-source Flutter IDE that was compatible with VS Code extensions could get popular pretty quickly due to how much more lightweight it would be compared to the Electron-based VS Code.

2

u/ventrix334 Apr 16 '22

What use case would that be? Which developer struggles with an IDE that might use 200mb RAM instead of 40mb? Don't forget that electron/nodejs simply takes as much memory as available. You can run them both with a lower profile without any issues.
I have electron apps on old Raspberries in production. Are you saying developers have even less? It's completely illogical to base an entire tech stack on "oh, it uses a few more ram on an average 16-32gb ram machine".

1

u/paulens12 Oct 05 '23

VSCode's memory usage is a real problem, believe it or not. My work requires quite a few extensions and sometimes up to a dozen workspaces open on the same day. I would keep them closed, but opening a new window takes so long that I usually just keep them open for as long as I can.

Don't forget that electron/nodejs simply takes as much memory as available

And that's exactly the problem. It would be fine if I only had one of those apps running on my system. But I have way too many of them and they all try to eat as much RAM as they can. What does that lead to? Having 32GB of RAM doesn't help at all, my system routinely reaches 90% memory usage, and that does not make any electron app reduce its memory usage if they're already open. Then I try to open something that actually needs the memory and I can't because everything is already allocated to electron.

/rant

1

u/milogaosiudai Oct 13 '21

wow. thats a huge difference.

15

u/FormerGameDev Oct 13 '21 edited Oct 13 '21

This will be an interesting conversation once production Flutter desktop apps start surfacing.

Yeah, probably should've just started and ended with that sentence.

Let's compare two completely different things, that achieve, ultimately, two nearly completely different things, one of which no one is actually using, to see which one does .. what.. better?

... edit: just realized i'm in the FlutterDev sub posting this. Oops. Apologies if my tone comes off incredibly poorly, but I just don't really see the point of having a comparison, when all you can really compare is Hello, World.

If your choices of platforms come down to how fast something starts and how small it's installation is, you're probably not really interested in either of these.

20

u/kitanokikori Oct 13 '21

Yeah they forgot the comparison "Typing in a text box":

Electron:

  • Works

Flutter Desktop:

  • Absolutely does not work

I like Flutter but right now its desktop product is completely unusable

2

u/dancovich Oct 13 '21

In what circumstances typing in a text box doesn't work in Flutter Desktop?

I just made a small app for a friend and used Flutter. There's a text box in the app and it does work.

Since it's only one, maybe I'm not hitting a bug? Do you know how to trigger it?

2

u/kitanokikori Oct 13 '21

On Windows the last time I tried, literally keys as simple as backspace doesn't work. Things like IME input (i.e. being able to type in Chinese/Japanese/Korean) or support for Deadkeys (i.e. all of Europe) absolutely do not. This might not be a dealbreaker for OSS or hobby projects, but for anything professional that is 100% unusable

2

u/dancovich Oct 13 '21

At least on Flutter 2.5.2 and a Windows app, all keys I tried worked, including backspace. I can't test the other things you mentioned though.

It's still in beta and the Flutter team doesn't recommend using Flutter Desktop in production, so I expect those things to get fixed with time.

-2

u/[deleted] Oct 13 '21

I’m going for it: I expect Flutter to be discontinued before it gets “production” Desktop support.

This was a hobby project at Google that took off, but still has major cross-platform issues (iOS jank has barely even been acknowledged, let alone fixed, this thread is debating keypresses, KEYPRESSES!).

It is not a revenue driver for Google at all, and they will simply nope out at some point in the future. They’ve done it before, they’ll do it again.

Forget about Flutter Desktop, I wouldn’t even be writing anything in Flutter right now.

Disclosure: have written small cross platform apps in flutter, find it generally enjoyable to use but can’t stand the fanboyism in the community.

7

u/dancovich Oct 13 '21

I think you're wrong about Google commitment to the project, but even if you're right, the entire Flutter ecosystem is open source, so there is absolutely nothing keeping the OSS community to just continue work on it. That's different than Google's closed source projects where if they drop it then it's dropped.

We are discussing key presses on a platform Flutter doesn't officially support yet, so I don't know why it's so jarring that a beta product has bugs.

Disclosure: I work at a company that has several Flutter apps already in production, many of them developed by me. Would I recommend Flutter for desktop right now? Hell no, I don't even trust it for web apps which are technically out of beta. Doesn't mean that what Flutter can already do isn't done well.

2

u/ventrix334 Apr 16 '22

Open source does not mean "access to everything". Some parts might fall under different licenses. Open source does also not mean "I can use whatever I want however I want it".
Don't forget that Flutter is deeply coupled with Skia and even the Flutter team itself struggles with keeping them in sync and implementing skia features (we still lack very simple GPU stuff like shader programming, even though Skia has the APIs for it for YEARS)

2

u/dancovich Apr 16 '22

Open source does not mean "access to everything". Some parts might fall under different licenses

There is access (simply being able to see the code) and there is usage. Open source does mean you have access to everything that is open source. If you have no access to a part, then that part isn't open source.

But as you said, it doesn't mean you can use it however you want. In Flutter's case it's a moot point because it is under BSD- which is extremely permissive, the only caveat is that the name of the project (Flutter) can't be used by forks. So if the project ever dies, it can easily be reborn under a different name.

Don't forget that Flutter is deeply coupled with Skia

Also licensed under BSD-3, so it's not really a problem. Dart is also BSD-3. As far as I know, no core component of Flutter is stuck behind any problematic licenses, so the point I made that the community can just continue work on the framework is totally valid.

3

u/Baul Oct 13 '21

Flutter is the "native" UI toolkit for Fuchsia, which is decidedly not just a hobby project.

Feel free to write off Flutter, we'll see you in five years.

1

u/ventrix334 Apr 16 '22

Fuchsia itself is a little prototype project though (since 2015!). It has as of yet absolutely no use case or actual concept behind it.

Also Fuchsia is not dependant on Flutter at all. You are able (in theory, as of right now you cannot) to write apps in Flutter for it as you can with Java, Swift, javascript, Rust and so on. Fuchsia + Flutter is a little COPIUM from the Flutter community to feel more safe.

2

u/Zarkex01 Jul 11 '24

"Prototype project" used by BMW, Philips Hue, Sonos, Google Wallet, eBay, Alibaba, Tencent etc.

1

u/ventrix334 Jul 27 '24

None of them use Fuchsia (especially not 2 y ago). We are talking about Fuchsia, not Flutter.

1

u/Baul Apr 16 '22 edited Apr 17 '22

Also Fuchsia is not dependant on Flutter at all. You are able (in theory, as of right now you cannot) to write apps in Flutter for it as you can with Java, Swift, javascript, Rust and so on. Fuchsia + Flutter is a little COPIUM from the Flutter community to feel more safe.

Sure, in the same sense that Android isn't dependent on Java/Kotlin at all. You are able to write apps in Flutter, React Native, Electron, etc. The "native" apps for Android always have been and always will be Java/Kotlin, just like Fuchsia is designed for having native Flutter apps.

Unless you really find those Android apps in ChromeOS to be "native," you know this argument is BS.

0

u/[deleted] Oct 13 '21

Flutter is “a” native UI toolkit for fuschia

4

u/Baul Oct 13 '21

Flutter is the UI toolkit for Fuchsia.

Fuchsia has the ability to run Android apps via ART, just like it can run web apps via a browser, but if you want to write an app for Fuchsia, Flutter is the toolkit.

1

u/paulens12 Oct 05 '23

I'm from Europe and I have no idea what a "dead key" is

-3

u/FormerGameDev Oct 13 '21

I'm not familiar with it, came over here from a post to /r/electron. I thought perhaps "Oh, is Flutter a new 'make a desktop app with a browser' thing, or a new 'make a desktop app with v8' thing".. but.. no.. it's not even kind of sort of related to electron.

The baffling part to me, is that a comparison would make sense, if both of them shared literally any major feature, but this comparison is about as useless as comparing the execution time of a bubble sort in C++ to the time it takes to serve a network request in PHP, and attempting to draw some sort of conclusion from it.

As far as I can tell, the only similarity is that they both allow a developer to write code. And not in the same languages, or the same contexts.

2

u/[deleted] Jul 17 '22

Flutter and Electron both allow you to create beautiful, highly customizable, cross-platform desktop applications. Some of the best desktop applications I’ve used have been Electron applications. The problem is that they are slow and use a ton of memory. If Flutter can address that while still allowing you to create beautiful user interfaces then it is highly intriguing.

2

u/razorree May 13 '24 edited Jun 05 '24

I see only horrible Electron apps, overly heavy and slow .... such apps a few years ago were weighting 1-10MB ... now >200-500MB .... it's a joke.

maybe VS Code is the only exception, which runs nicely and feels quite ok (or maybe because I have one of the fastest notebook CPU and 32GB of RAM now.... still, a joke)

1

u/[deleted] Jun 05 '24

I generally agree. Discord feels pretty good in my experience as with MS Teams. Certainly not at the level of a native app but they also look a lot better. There just isn’t a good cross-platform UI framework right now.

1

u/FormerGameDev Jul 17 '22

9 months ago, there was no one / hardly anyone using it, and it wasn't useful for much of anything. I don't know how much that has changed in two major versions since then, but a casual google search doesn't really find anything.

It's also still a completely different thing entirely from Electron.

1

u/[deleted] Jul 17 '22

It is certainly different from Electron but they fill similar roles on desktop. Adoption still isn’t great on desktop but I think it’s improving.

1

u/misterjyt Oct 13 '21

Electron is really great for large js code base,,

6

u/[deleted] Oct 13 '21 edited Oct 13 '21

[removed] — view removed comment

2

u/[deleted] Oct 13 '21

Electron is geared toward those who deliver web first and desktop later

Well, what you’ve just said is not only not provable, it’s not true. It’s your (incorrect) opinion.

1

u/[deleted] Mar 10 '22

Lmfao thats exactly what Electron is. Want proof? Read the damn docs lol.

1

u/[deleted] Jun 19 '24

It says in their docs that Electron is a solution for cross platform applications with single code base in JS

1

u/itsjzt Nov 23 '24

Build cross-platform "desktop" apps with JavaScript, HTML, and CSS