It has always been rumored that Qt is bloated so programs written in Qt should be bloated. Some even argued that the LXDE developers made a wrong decision on the migration to LXQt.
Why not replace the assumptions with some experiments?
In fact, LXQt 0.11 even uses slightly less memory than XFCE (with gtk+ 2). After cold boot, LXQt uses 112 MB in the testing environment.
This is the testing setup:
- Debian testing: Clean install in Virtualbox 5.1.6 (2016-10-02)
- CPU: 2-core
- RAM: 512 MB
- Resolution: 1024 x 768
- Desktop environments: LXQt 0.11, XFCE: 4.12.3, Cinnamon 3, Gnome 3.20
- Cold boot 1: After cold boot, I opened the application menu to make the icons loaded. Then, open an “xterm” window and get the result of `free -mh` command.
- Cold boot 2: same as 1, but it’s tested after installing Cinnamon and Gnome3, which bring some additional system services, so the memory usage after boot increased for all DEs.
- Open default FM: After cold boot, open the default file manager to browse the home directory. (For openbox, which brings no file manager, the gtk2 version of pcmanfm is used)
The memory usage of LXQt is quite similar to the original LXDE (gtk2) while many new features are added. Actually I used LXQt on my Raspberry Pi instead and it works flawlessly. It’s a pity that Rasbian does not ship with LXQt by default. 🙁
Next time, if others tell you Qt is bloated, and LXQt is not lightweight anymore, just direct them to this post.
To see is to believe:
There has long been needs for a simple Qt frontend for pulseaudio-based audio mixer. So I ported the gtk+ version pavucontrol program to Qt5 for use in LXQt. Here is a screenshot.
The source code is here. https://github.com/lxde/pavucontrol-qt
Since the original source code of pavucontrol is written in C++, it becomes trivial to port it to Qt. The whole porting process took me two days only. Porting programs from gtk+ 3 to Qt 5 is not really that difficult as long as you know how to do it. You see the proof. 🙂
Since the release of LXQt 0.9 several days ago, many people are curious about its memory usage since in the release announcement we mentioned the use of two libraries from KDE framework 5. Don’t worry! They are just “pure Qt libraries” without other KDE dependencies (Thank you KDE guys!). Good engineers always base their design desicions on careful analysis, experiments, and measurements, not politics. If a library works pretty well, it does not really matter where it comes from or it belongs to which camp. If it’s free software and it’s suitable for our need, I’d say “use it”. Here are some numbers of memory usage after cold boot.
- Debian testing (32 bit)
- LXQt 0.9, Qt 5.3, and KF5 packages are taken from Siduction
- Running in Virtualbox 4.3.20
- RAM: 512 MB
- CPU core: 1
- Screen resolution: 1024×768
- Measurement: Open xterm, and type `free -mh` (cache and buffer are excluded)
Memory usage after cold boot:
- LXQt 0.9: 118 MiB
- LXDE: 98 MiB
- XFCE: 107 MiB
- plain Openbox (without running any apps): 70 MiB
Well, for those who still remembered my previous report, the memory usage increased. But wait! All of the DEs, including Openbox, have the same degree of growth in memory usage. So it’s more possibly caused by the upgrade of the system itself. If you see the difference between plain openbox and LXQt, we only added 38 MiB (LXQt 0.8 added 37 MiB). Given that we migrated to Qt5 and added new features, both of which should normally increase memory usage, the current results are reasonable. Seriously, there are still room for more optimizations but we need some time to finish them.
LXQt aims to be a “modern” desktop with some “classic” designs which does not get in your way. We’re not going to clone KDE. Besides, don’t worry about resource usage. That’s the challange for developers and we’ll fight for it. 🙂
As we’re going to have a new release for LXQt 0.9, I’d like to provide some performance tips for users and packagers.
- Consider compiling lxqt-panel and lxqt-runner with menu-cache support whenever possible:
Menu-cache is a mechanism to cache the generated freedesktop.org application menu so we don’t need to parse hundreds of files everytime. Though you can compile lxqt-panel and lxqt-runner without it and things still work, these two components will generally load faster if you use menu-cache.
- Compile libfm with libexif:
Libfm if the core library of PCManFM file manager. When compiled with libexif support, it can extract the thumbnails created by the cameras which are often embedded in jpeg files. So we can avoid loading the photo and generate the thumbnail ourselves. With libexif, loading folders with many photos will be faster.
- Try to “prelink” your system:
When you launch a program, your system will load it alone with the libraries it requires. Then, dynamic linking will be performed to make these libraries work together. The process could take seconds in some cases and affect the speed of program startup. By using “prelink”, part of the linking/relocation process can be done once and cached; then in the future the dynamic linking becomes faster. It’s tool worth trying if your desktop takes quite a long time to login.
- Avoid GTK+ theme:
Qt developers did a great job and provided a “GTK+” style for theming the Qt programs so they can look like GTK+/Gnome programs when running in Gnome. The magic behind this is simple. Your Qt style engine loads GTK+ 2 and creates fake Gtk UI elements. Then, copy the images painted by GTK+ to your Qt widgets. By using this, you have both Qt and GTK+ 2 theme engines loaded for every Qt program. Not really a big deal since the operations are still fast enough, but if you don’t need a GTK+ theme, don’t use it. Try “fusion” for Qt5 or “Cleanlook” for Qt 4.
- Some notes about gvfs:
Removing gvfs won’t make your file manager faster. PCManFM-Qt does not use it for most of the local file operations. So it’s safe to keep it around since it does not slow down things. We used “gvfs” from Gnome internally for trash can, volume management, and mounting various network filesystems. Yes, the UI is in Qt and its core uses few Gnome stuff. Don’t hate gvfs just because there’s a “g” in its name. It’s a quite good VFS implementation which does not have Gnome dependencies. So don’t remove it just because its name contains a “g”. It provides you some good features, including mounting sftp filesystems or accessing Android mtp devices if you have proper plugins installed.
Generally speaking, it might be a good idea for packagers to add “gvfs” to the dependencies or package suggestion list of pcmanfm-qt.
- Avoid Qt 5.4.0 if possible:
We encountered several weird regression bugs of Qt 5.4 while debugging LXQt. It breaks drag and drop crossing different programs. With Qt 5.4, you cannot drag a file from my file manager to other programs, but it’s not my fault. 🙂
(The bug will be fixed in Qt 5.4.1, which is not yet released.)
We’re going to release LXQt 0.9 very soon!
Hope these tips help. Cheers!
Although people often compare LXDE and the “so-called” Qt port, LXQt with each other, they are actually from different code bases.
The most parts of LXQt are actually built on top of razor-qt, a lightweight Qt-based DE with the same philosophy as LXDE. We reorganized the source code of razor-qt and removed unused pieces. Then we ported several LXDE components to Qt and also developed some new ones. Hence it’s more the merge of developers than the merge of the actual source code. That’s why they have slightly different feature sets. Without the work of razor-qt project, we can’t have LXQt now. Its developers deserved the credit. Since the story is too long for the tiny “About” dialog, I wrote the blog post here to thank their contributions.
Long live free software!
Yes, it’s about the gtk+ version LXDE, not LXQt.
Previously, razor-qt and lxde project merged and formed LXQt project, which just had a 0.8 release. Though the original plan was to migrate to Qt, this does not mean that LXDE is dropped. As many of the users have noted, many LXDE gtk+ components got updates recently. LXDE is still actively developed and maintained by the developers lead by Andrej N. Gritsenko (LStranger) and as long as gtk+ 2 is in use, I believe that they’ll keep working on it. We even got some patches for gtk+ 3 recently. Yes, gtk+ 3. This does not mean that LXDE is going to use gkt+ 3, but it’s a clear indicator that LXDE is not dead. If you’re not a fan of LXQt, don’t worry, you can still use LXDE. Also I want to say “thank you” again to LStranger who work really hard to keep LXDE so others can have some time to focus on LXQt while keeping our promise to the users.
About LXQt, the 0.8 version is quite stable and we have the required features, but of course it’s not good enough and have room for improvement. We’ll keep working on that, too. For the part I’m responsible for, the file manager, I’ll try to add the features that exist in the gtk+ versions but abscent in the Qt port. Also, I’m going to do more bechmarks for LXQt recently. Other developers are working on code cleanup and removing dependency on X11 so we can move to Wayland later.Both LXQt and LXDE are actively developed. Stay tunned! 🙂
After the first official public release 0.7, the LXQt team is working on making it better. Our recent focus is fixing existing bugs and migrating from Qt4 to Qt5, which is required if we want to support Wayland. Now we had something to show. The latest source code in our git repository can be compiled with Qt5. by just passing -DUSE_QT5=ON flag to cmake. Building with Qt4 is still supported until the next release, but later we’ll focus on Qt5.
Recently we also got some patches from the community and also a new developer joined us. We’re now fixing some remaining bugs. Hopefully we can have 0.8 release soon. 🙂
It’s known that system admin tools for LXQt were lacking.
This is no longer true. A new component lxqt-admin landed int our git repo. Please see the screenshots. 🙂 These are “desktop-independent” pure Qt tools based on system-tool-backends.
lxqt-admin-time: Tool to configure date and time.
lxqt-admin-user: Tool to manage users and groups.
We know that LXQt is not good enough, but it will getting better and better. Long live LXQt, the classic desktop!
After the initial release of LXQt, I found that there is a FAQ. How’s the memory usage? Will it become a bloated memory hog because of Qt? Here are some numbers for you.
My test environment is the latest Debian stable installed in VirtualBox with 512 MB of RAM and 1 CPU core assigned. After cold boot, the memory usage is as follows.
- Plain Openbox only: 58 MB
- XFCE: 89 MB (with default configuration of Debian. This value will increase after xfce is ported to gtk+ 3)
- LXDE (gtk+ 2 version): 78 MB (add 20 MB to openbox)
- LXQt: 95 MB (add 37 MB to openbox, still has some room for optimization)
The screen resolution is 1280 x 1024. So a wallpaper roughly used 1280x1024x4 bytes = 5MB of RAM. If you don’t set a wallpaper, this number can be lower. Besides, this is a virtual machine so some special modules for vbox are loaded. I turned off printer service and network-manager applet since they’re not used.
Yes, the memory usage slightly increased, but the difference is really negligible. Moreover, LXQt has more features, such as a better program launcher and new power management stuff.
Apparently the gtk+ 2 version uses less memory, but we cannot use gtk+ 2 forever. It’s not a secret that gtk+ 3 is not a memory saver. So, I’d say Qt is really not that bad.
Why yet another DE? Why can’t you do something more innovative? I think the answer for this FAQ is simple.
- Nowadays everything goes mobile and touch, but we still saw unmet need for a classic desktop environment. Otherwise, Windows xp should have been killed years ago and Windows 8 should have high market share now.
- In the history of free software, we see forking everyday, but (successful) merging rarely happened. We want to prove that it actually works. People can focus on what they can share with each other, not how they are different.
The following is my personal opinion (not on behalf of other LXQt developers)
Seriously, if a 17 MB memory usage increment can buy us faster development, more active developers [Figure 1], more contributors, and a healthier upstream community, that’s definitely worth it. When I say healthier, I mean those who do not hold a “Follow our way, or go away!” attitude. This is just as important as other technical considerations when you choose a toolkit.
Many people like to argue that Qt is not C++ since it requires a pre-processor. Did anyone tell you that Gtk+ actually uses a preprocessor, too? Check the manpage of “glib-genmarshal” please. Without this pre-processor to generate some code for you, it will be awfully difficult to add signals to your GObjects. That’s not C language, right?
It does not really matter for users what toolkit you’re using given the final result works. Let’s save some time not arguing which is better and focus on what we can do with them. 🙂
Figure 1. A screenshot from Google Trend
Recently, PC-BSD developers just reminded us that there is an unmet need for a Qt desktop for BSDs. So, here you go. 🙂
As stated earlier, we’re not really Linux-centric. We support Linux better simply because we’re Linux users. Now with some help from several FreeBSD users, things can be different. I installed FreeBSD 10 in Virtualbox last week. After reading some docs and fighting with it we fixed some broken makefiles. Now the major components should work as expected.
Of course, there are still some Linux things which do not work (yet).
- lxqt-powermanagement: this requires upower
- lxqt-policykit: I haven’t test if policykit works for FreeBSD
- volume control applet: currently it only supports ALSA and PulseAudio. I’m going to implement OSS support for it.
- removable device applet: this requires udisks
- Reboot/Shutdown from the menu: We use logind/consolekit now. Any good alternative for BSD?
Other parts should just work. We hope that we can improve FreeBSD support more. Of course, help from the BSD community is needed.