Hacker News new | past | comments | ask | show | jobs | submit login

I've not learned Rust yet, but unless it does behave really weird, I can't believe that Electron and Qt have roughly same RAM usage. In my experience Electron has usually 2 to 3 times higher RAM requirements than Qt application of similar scope.



It's because almost all electron apps are written fully in JS.

In the context of the article, the UI is in HTML/JS and the business logic in Rust, thus the RAM is not so high.

On the other hand, Qt QML embed it's own JS engine which is not resources light.


Did you come to this conclusion by taking measurements using real apps? Because if this is just your gut feeling, that doesn't make sense. The base memory footprint of something like Electron (just a simple Hello World app) is likely already heavier than a complete Rust-only GUI app.

For a GUI app, business logic is usually not where your RAM budget goes.


Electron hello world ~40MB of RAM

Qt with QML Hello World ~40MB of RAM

Gtk-rs hello world ~20MB of RAM


Not sure where you're getting your numbers, but as a quick test I cloned an Electron Hello World app[0], bumped its Electron dependency to the latest version on npm, and ran it. It came in at around 90MB resident on the main process, with a GPU process of about 70MB, a "zygote" process of around 60MB, and a separate nodejs process around 35MB. Even if some memory was shared between those, that's still quite a bit more than 40MB.

[0] https://github.com/greggman/electron-hello-world


The UI, especially since it's in HTML/JS, is almost certainly going to use more RAM than the business logic in most cases.


QT these days is written in a JavaScript-esqe language and runs a modified WebKit to power the UI. It's as bad as it sounds.


> QT these days is written in a JavaScript-esqe language and runs a modified WebKit to power the UI. It's as bad as it sounds.

That's wrong.

QML has two mode: one "interpreted" ( the javascript-esque) and one that can be compiled to native C++ without js.

And WebKit / webview itself is a plugin for Qt, it is absolutely not required.


> QT these days is written in a JavaScript-esqe language and runs a modified WebKit to power the UI.

... that is entirely false. Qt has its own scene graph renderer which has nothing to do with WebKit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: