Arsen's Blog

Jupiter - The worst GUI toolkit that sadly is winning over.

Did I say Jupiter? Whoops, I meant Electron.

I personally think that Electron is objectively one of the shittiest things that has hit this world, next to Windows up high on the pedestal. I wanted to back my claims with evidence - and decided to test it: These two tests are ran under Fedora 26, with X.Org and default drivers, AMD CPU & GPU and 4GB RAM. It's an old laptop, hence pretty extremely bad with things.

The first test is the resource test. I am loading the following HTML page:

1
2
3
4
5
6
<!DOCTYPE html>
<html>
<body>
    <h2>This just wasted me 200MB RAM</h2>
</body>
</html>

The test is based on https://github.com/electron/electron-quick-start with a modified index.html And this is impressive. It used 5.1% RAM on a 4GB laptop. (208MB) I've remade a similar application in Qt:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <QApplication>
#include <QMainWindow>
#include <QLabel>

class MainWindow : public QMainWindow {
public:
    MainWindow() {
        setWindowTitle("test");
        QLabel *label = new QLabel("This used very little RAM");
        setCentralWidget(label);
        show();
    }
};

int main(int c, char *v[]) {
    QApplication a(c, v);
    new MainWindow();
    return a.exec();
}

The following was used to compile the code: g++ -fPIC -I/usr/include/qt5 -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtWidgets -lQt5Gui -lQt5Core -lQt5Widgets main.cpp This used 1.6% RAM on the same machine, which is 65MB RAM.

Qt is not the most lightweight, and I know that. But come on Electron, you can do better.

Now, in today's world disk space is mostly irrelevant. Until you begin to notice you have 7 web browsers installed on your PC due to webapps. The following sizes are for the libraries and headers used for each (according to du -sh):

Neither one of these includes dependencies, which are common between them, OpenGL, OpenEL, XCB, libX, et cettera When it comes to CPU usage, Electron and Qt both used a whopping 0%. Disclaimer: I know that a better measure would be load but there is no good way to measure it.

Start times were an interesting story. Qt took a near second, while Electron took a whopping 5 to start and render the page. After all these tests I believe that me referring to Electron as Jupiter is justified.

Thanks for reading, have a nice day.