How to drastically boost up your KDE 4 performance by using the Qt raster rendering engine

The release of the KDE SC version 4 series hasn’t been a success story in the first place. The first versions of KDE 4 are known to be buggy and slow. But the situation is constantly getting better. And since the release of KDE SC 4.3, it may be stated that the KDE software collection is quite useful in a productive environment. However, although the performance of KDE is constantly improving, it has never reached a state so far where it felt completely fast to me (such as GNOME, KDE 3, or lightweight desktop environments like XFCE, LXDE, or fluxbox do). A little bit of bubble gum always remained.

Until I found the »raster engine« of Qt. Qt can use different ways of painting widgets on your screen. On GNU/Linux and other Unix-like operating systems, Qt normally uses the X11/XRender method for that. But since Qt version 4.5, you can also instruct Qt to use the raster engine on X11 instead. The raster engine is the reference rendering engine of Qt 4, and it is used as the native painting method on Windows. Roughly speaking, instead of asking the X server to paint some lines, some circles, etc., the raster engine only takes a raw shared memory image buffer from the X server and paints all the stuff it needs on its own into this buffer. Theoretically, the X11/XRender method shouldn’t necessarily be slower, but it is. I won’t get further into the details here, but you can get some deeper information about the Qt raster engine for example here or here.

You can start a Qt program using the raster engine directly by adding the -graphicssystem raster parameter on the command line. And as you can see, this may have a strong impact on the applications performance. But, as far as I know, there is currently no way of changing the Qt rendering engine globally without recompiling it. There are some workarounds (BTW: You need to add the /usr/share/autostart/*.desktop directory to the goraster.sh script posted there for the script to have an effect at system startup), but imho they aren’t very satisfying.

Therefore, I created a PPA repository for Ubuntu Lucid containg Qt compiled with the raster engine enabled. If you have added the Kubuntu backports PPA repository to your software sources to get newer versions of KDE SC, you should use this repository, because the Kubuntu backports PPA provides a newer version of Qt.

With the help of the Debian package versioning scheme, I guarantee that my packages only supersede the corresponding Qt packages of the same version, but not newer ones. This is necessary to keep the package dependencies consistent. I try to update my repositories as soon as a new version appears in the Ubuntu repository or the Kubuntu backports PPA, but I can’t promise to be always fast ;).

Some known issues at the end: The rastering engine can slow down the process of X-forwarding your Qt programs to another desktop, because with raster, complete images need to be transfered through the network instead of (more or less) only X commands. Furthermore, the rastering engine may break the OpenOffice.org KDE integration. Use the openoffice.org-gtk package instead or start OpenOffice.org with -graphicssystem native.

Have fun! ;)

UPDATE: Since Qt version 4.7, you can globally set the graphicssystem to raster via the QT_GRAPHICSSYSTEM environment variable. See here. Thanks lelamal for the comment.

UPDATE2: BTW: The easiest way I found to switch to the rastering engine with Qt 4.7 is adding export QT_GRAPHICSSYSTEM="raster"; to your .profile.

20 comments to How to drastically boost up your KDE 4 performance by using the Qt raster rendering engine

Very interesting! Even with KDE SC 4.5 I still feel that the computer is freezing every now and then, even though the processor isn’t really working. I have NVIDIA card, so I sort of just accepted that that was the problem. Would be great if something like this could improve the experience! I hope the packagers try out this tip!

Qt raster is definitely the only way for me to run Kubuntu on my NVIDIA Quadro NVS 140M (Thinkpad T61). Without the raster option set, the accelerated graphics performance is unbelievably slow — especially KDE apps such as kile, kmail, dolphin and kate behave like running on a PentiumII with 256MB RAM. Even typing few words and opening a “save”-dialog takes literally minutes.
Now, after switching back to Qt raster as described in the previous comment by micu, and using Compiz instead of kwin, my KDE feels fast and beautiful just as Gnome 3. I am of course using the proprietary nvidia driver; nouveau does not work yet with the Quadro NVS 140M. But that will, hopefully, change soon…

When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is
added I get three e-mails with the same comment. Is there any
way you can remove people from that service? Appreciate it!

Hi this is kinda of off topic but I was wanting to know if
blogs use WYSIWYG editors or if you have to manually code with HTML.
I’m starting a blog soon but have no coding expertise so I wanted to get advice from someone with experience.
Any help would be enormously appreciated!

There are many competing Ultimate Testo Explosion models of treadmills to choose between. amongst different things the house exercising treadmill is the last piece of system for a cardiovascular exercising. The belt or deck is the location on which the real strolling or on foot takes region. http://www.strongtesterone.com/ultimate-testo-explosion/

And we have not even touched on the other element of the crime:
that exhibitionism is a willful act carried out with the
intention of insulting and offending the victim. So you’re probably thinking “Well, that’s what focus is”
. But, a better way, that will always give you access to your files, is
to store your files on Google Docs.

For typical example, if your dovelike-self finish off a pitcher of Bitter
Ale or Peruvian wine en plus the validated measurement and purpose to bump against a AMC,
you might later reveal yourself inside the Escambia county jail.
eval(ez_write_tag([[580,400],’brighthubeducation_com-netboard-1′]));.
We are godlings – so what we speak is creative – So, we want to be
sure we Say only what we mean.