Background
First of all, this is not a question about opinions. I am assuming that we are talking about Unity 3D and on a computer with decent graphics configuration. By "desktop environment", I am assuming the most generally accepted definition of what a DE means.
I have seen lot of comparisons made and many people saying that Unity is the slowest desktop environment on Ubuntu (compared to others like Gnome, XFCE, LXDE etc.). I don't know whether people took KDE into consideration or not.
Question
- Why is Unity slow compared to other desktop environments? Is it just because of the high graphics used in Unity or something else? (I don't know what in unity makes it run slow.).
- What changes can be/ are being made to Unity in order to make it
faster/ improve its perfomance?
The answer depends heavily on 3 major factors contributing to the feeling of "slow" or better yet, less FPS:
- Version of Ubuntu (Updated, not just left as it came when it was released)
- Video card (Ati, Intel, Nvidia)
- Driver version (Proprietary, Open Source, Actual Version)
I'll explain each point:
Version of Ubuntu
For the version of Ubuntu, it is known that using 11.10 with Unity will suck. Literally make the PC suck at even opening Gedit or Nautilus in most cases. Trying to play a game in either OpenGL or through Wine with DirectX or OpenGL will result on less FPS than normal, even compared to any other DE. This drastically changes in 12.04 and then again in 12.10 where the FPS count starts to go up.
Since the latest is the 12.10, I should mention that for some, using 12.10 without upgrades does not address several key problems that were fixed in Compiz and Unity around a month after release. So any 12.10 user has to upgrade to receive this benefits. This is because the 2 most important parts that are talked about when FPS and OpenGL performance comes to mind are Unity and Compiz (Compiz being the most important one when it comes to a performance impact).
The benefits and enhancements that both, the Compiz project is getting throughout the 0.9.8 Series and the 0.9.9 Series and Unity is getting in the 7.x Series are actually very impressive.
Tests in Phoronix and some of my own showed that for Nvidia cards (The only tests I could actually do were with Nvidia cards) the performance has gone up. And not just 3 or 4 FPS but about 20 to 70 FPS depending on the Video card and Driver.
This is important, since, depending on the Ubuntu version the user is using, it will also depend on the Compiz and Unity version available for it, and the performance cost that comes with it.
Since Unity needs Compiz, this will be the biggest cause of low FPS count, but not much as before, or at least 2 versions ago. Running the Benchmark utility of Compiz while playing video games in Wine or Open Source ones gave me very good FPS in 12.10 and even more while I am testing 13.04 with the latest 313.xx series of Nvidia.
It should be noted that video performance is one of the points that will be dealt in 13.04 (And to some big degree in 12.10 and 12.04) because of a commitment that Ubuntu has for it's users and Steam (Valve). Not only is Ubuntu and Valve working on this, but Nvidia and Intel have joined also with many updates that have jumped the FPS count time and time again. If you are following the improvements that are coming to the 3.7 and 3.8 Kernel you will see some of them.
Video Card & Driver Version
It has been known that performance wise, Nvidia is on top of it, followed by Intel and Ati (This is not to be confused with ease of use, since Intel is much better at that). The latest drivers for Nvidia (For example the 306.64, 310.19 and 313.09) have all brought OpenGL performance improvements specifically for Unity. Specially the 313.09 which is used to improve Compiz even further.
Now, not only is Nvidia doing a lot of work to improve the road for Compiz/Unity. Intel is also hard working (Very hard) on several key features for Mesa, which should improve performance in general for all Intel video cards, specially the 965, 2000 HD, 3000 HD and 4000 HD Series. Lastly Ati/AMD has also several updates already made that will fix many bugs and issues with Compiz.
So in general, having the latest driver for each will improve performance but having an Nvidia card will enhance it more, followed by Intel and Ati.
After reading all of this, what changes are being made to improve the performance in general, well here are some:
Nvidia is working since several versions ago on improving Unity performance with more than a 50% enhancement in general over older versions
Intel is working with Mesa to improve Unity performance
Ubuntu and Valve are working on improving performance for Compiz and Unity
As seen in Launchpad, there are several fixed made to Compiz to improve responsiveness and better performance in general (Including memory and cpu usage)
As seen in Launchpad, Unity has received many fixes in regards to most problems encountered by end users
Compiz has lowered by more than 50% the amount of memory it used a year ago.
Unity feels faster and lighter compared to the version used a year ago.
There is some work done by Sams Spilsbury for the latest Compiz and Unity that will address some common problems known with Unity.
Kernel versions 3.7 and 3.8 will bring video improvements in general
So as you can see, there is much work that is being done to improve Unity and Compiz. To be fair, comparing Unity to Xfce or Lxde is not fair. This is like comparing a bike to a car. Both can do some things better. Compiz offers for example some very neat effects that Xfce or Lxde do not and even though most of us do not use them, they are an option (Like the cigar lighter inside the car).
Same goes for comparing KDE, Gnome3 and any other DE to low end DE. They are low end for a reason. They tend to avoid making huge changes that will impact performance, while high end DE will try to add features that might take more resources at the beginning. For example, having widgets, the ability to rotate a window to any degree possible, having a blur effect that hides the background or having an animated background at that. There are options that some uses enjoy that are offered by some Desktops that others DE do not need or use since they are more oriented towards a low end system.
With this in mind, anybody that has tested KDE since the 4.0 release knows what huge improvements it has received up till the latest 4.9 version. Huge ones indeed. Anybody that has tested Gnome 3.0 up to the latest 3.8 release knows of the huge changes in performance it has received and anybody that has tested Unity from the 3.x up to the 6.x (And soon 7.x) will know how the performance has jumped. I for one miss gnome2 for example, but there are several cases where I can't use gnome2 for since Unity is much friendlier and quicker in helping me achieve some of this cases.
So what tips I could give to improve performance?
Well install the Compiz Config Settings Manager (ccsm)
and play with the OpenGL plugin:
Some of this options will enhance performance, others I needed to avoid video problems. If anybody finds the question about this I will be happy if they edit this answer to include a link to it here. I can't find it right now but I know there was an answer that talked about this.
Other is updating the drivers and if possible, using Nvidia. Other than that, waiting for 13.04 will be a worthwhile.
For some reviews, here are benchmarks from Phoronix that check how Unity is performing on 11.04, 12.04, 13.04 and 13.10:
Desktop Benchmark 11.04
Desktop Benchmark 12.04
Desktop Benchmark 13.04
Desktop Benchmark 13.10
And this is what has happened with Nvidia over the past months
Also some articles about Ati/AMD HERE, HERE, HERE and HERE
Last, Intel, Mesa and Opengl HERE, HERE and HERE