/, News, Opinion/Linux Desktop Compositors — Performance and Functionality

Linux Desktop Compositors — Performance and Functionality

Desktop performance on Linux can vary with different environments, window managers, compositors, and graphics drivers. Depending on the driver and environment in use, your desktop’s responsiveness and performance can vary wildly. The compositor is among the most vital components for good desktop UX on Linux. Here’s a brief rundown of a few of the most popular compositors.

See Also: Why We’re Still Recommending the GT 710 For Passthrough Hosts

What is a compositor?

A compositor is an application that gives each window a buffer to render to. Each buffer is put into one final image that the compositor outputs to the display. Each frame of each running application goes through the compositor. A well-written compositor is critical for a smooth desktop experience. Compositing offers two main benefits. Vertical synchronization, or vsync, prevents screen tearing by waiting on the display to update before updating the display. Compositors can also add effects like transparency, animations, and blur.

Windows has used the DWM compositor since Vista, enabled by the Aero theme. MacOS has used the Quartz Compositor since its initial release of 10.0 in 2001.

On Linux, most desktop environments include a compositor, but performance varies on differing hardware.

GNOME 3

Despite its position as the default environment in most major Linux distributions, GNOME still has some serious performance problems. At the heart of these is the design of its window manager, Mutter. Lots of core functionality is done on the same thread as the compositor. This can lead to choppy performance while the system is under load. It can also lead to bugs like the mouse cursor freezing while opening programs.

Fortunately, there are a few possible solutions to try. On NVIDIA graphics, enabling the High Performance mode for PowerMizer seems to improve performance. Using fewer extensions also helps free up resources.

One category that GNOME 3 does well in is unredirecting for full-screen applications. Unredirecting involves allowing specific applications to bypass the compositor for better performance and less latency. The compositor automatically unredirects full-screen games, for example. This can cause tearing in full-screen videos, however, but there is a simple fix.

KDE Plasma 5

Plasma 5 has come a very long way since its initial release in 2014. KWin has become quite solid in terms of stability. Performance is much improved. Unfortunately, it’s still not perfect. On NVIDIA hardware, while there are still some synchronization problems, performance is generally fluid. Intel’s wonderful Linux drivers, along with AMD’s open source drivers, are able to drive KDE very nicely.

Plasma is also one of the few major desktop environments that can run properly with compositing completely disabled. If you do not care for vsync, disabling it can reveal sizeable performance gains.

KDE Plasma 5 also has an option in its settings to unredirect full-screen windows. However, in my testing, I have observed that this only disables again after closing the application. Simply alt-tabbing out does not re-enable compositing like on GNOME 3. Of course, it can be tweaked in the KDE System Settings – your mileage may vary.

XFCE4 and MATE

XFCE4 and MATE both include compositing. Xfwm4 and Marco are XFCE4’s and MATE’s compositors, respectively. Marco does not support OpenGL acceleration or vsync, and as such usually experiences screen tearing. Xfwm4 does support OpenGL and vsync as of version 4.13. Unfortunately, my testing reveals that Xfwm4’s vsync does not function on NVIDIA proprietary drivers.

Fortunately, XFCE4 and MATE use light compositors – performance should be fairly decent. You can disable XFWM4’s compositing in the “Window Manager Tweaks” section of the Settings application. You can disable MATE’s compositing via the following command:-0.01%-0.01%-0.01%

gsettings set org.mate.Marco.general compositing-manager false

Changing “false” to “true” will have the inverse effect.

UPDATE 4/3/2018 – It has come to my attention that as of MATE 1.20, Marco does in fact support hardware acceleration via DRI3/XPresent. Unfortunately, the NVIDIA drivers do not support these extensions.

Compiz

Compiz, an alternative window manager with built-in compositing, offers an alternative for users of MATE and XFCE4, among other environments. There are two versions – the 0.9 series and the legacy 0.8 series. The 0.9 series is generally recommended as it plays nicely with newer hardware. Canonical implemented Ubuntu’s formerly default desktop environment, Unity, as a Compiz plugin.

Compiz is known for running quite well on most hardware. Keep in mind that it has a reputation for being a little bit unstable in certain scenarios – again, your mileage may vary.

Unfortunately, due to Compiz’s combination of a WM and a compositor, you cannot use it together with standalone WMs like Openbox or i3wm. In situations like this, you can try Compton.

Compton

Compton, a fork of xcompmgr-dana, has evolved into a relatively lightweight compositor for X11. Many configuration files for Compton are available online. Compton is commonly used with i3wm, XFCE4, MATE, and many other environments. Compiz and GNOME 3 require use of their built-in compositor, so Compton is unavailable on those platforms.

Unfortunately, Compton seems to have issues re-drawing windows while dragging/resizing them. As such, it’s generally more pleasurable to use Compton with a tiling window manager. Keep in mind that your experience may vary depending on your video card drivers.

Compton can unredirect full-screen applications when only a single monitor is in use. On a multi-monitor system, the user must manually stop and restart Compton when starting and stopping a game for maximum performance, respectively.

Looking to build a machine to use with device assignment? Check out the VFIO Increments page. Looking for support? Check out our Discord.


Images courtesy WikiMedia Commons

By |2018-04-04T00:12:26+00:00March 29th, 2018|All Articles, News, Opinion|2 Comments|1226 Views

About the Author:

Linux/Unix enthusiast, virtualization power user. I like to experiment with obscure software and use obscure systems.