Compiz is absurdly heavy on CPU

Bug #884387 reported by Marc Bowes
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
compiz (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Since upgrading from 11.04 to 11.10, I've noticed incredibly poor performance with Compiz and progress bars. For example, I just attempted a network copy of a directory of files (10's of them). My computer ground to a halt while the copy went, but as soon as I minimized the progress bar things improved dramatically.

Curious, I peeked at `strace` and noticed it is spinning on reading from a UNIX socket, receiving several EAGAIN's for each successful read. If I maximize the progress bar, there are additional reads (some successful, some EAGAIN) as well as poll() and sched_yield() calls. This behavior is consistently reproducible and results in a 10% increase in CPU load by compiz when the progress bar is maximized.

I will attach the two straces as well as a lsof. Opening them side-by-side with a difftool such as meld clearly shows the additional system calls being made when the window is maximized (which is when my system effectively became uselessly slow).

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: unity 4.24.0-0ubuntu2b1
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 280.13 Wed Jul 27 16:53:56 PDT 2011
 GCC version: gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
.tmp.unity.support.test.0:

ApportVersion: 1.23-0ubuntu3
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,compiztoolbox,decor,place,session,snap,gnomecompat,regex,move,mousepoll,animation,wall,fade,grid,vpswitch,resize,imgpng,scale,workarounds,expo,ezoom,unitymtgrabhandles,unityshell]
CompositorRunning: compiz
CurrentDmesg:
 [ 26.978072] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
 [ 27.754662] EXT4-fs (sdc1): re-mounted. Opts: errors=remount-ro,commit=0
 [ 28.235217] init: plymouth-stop pre-start process (1330) terminated with status 1
 [ 33.734637] EXT4-fs (sdc1): re-mounted. Opts: errors=remount-ro,commit=0
 [ 37.144030] eth0: no IPv6 routers present
Date: Mon Oct 31 21:24:39 2011
DistUpgraded: Log time: 2011-10-13 21:06:09.956598
DistroCodename: oneiric
DistroVariant: ubuntu
DkmsStatus:
 nvidia-173, 173.14.30, 2.6.38-11-generic, x86_64: installed
 nvidia-173, 173.14.30, 3.0.0-12-generic, x86_64: installed
 nvidia-current, 280.13, 2.6.38-11-generic, x86_64: installed
 nvidia-current, 280.13, 3.0.0-12-generic, x86_64: installed
ExecutablePath: /usr/bin/compiz
GraphicsCard:
 nVidia Corporation G80 [GeForce 8800 GTX] [10de:0191] (rev a2) (prog-if 00 [VGA controller])
   Subsystem: Giga-byte Technology Device [1458:3439]
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
MachineType: Gigabyte Technology Co., Ltd. EP45-DQ6
ProcEnviron:
 LANGUAGE=en_ZA:en
 PATH=(custom, no user)
 LANG=en_ZA.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-12-generic root=UUID=6269bff0-61a9-4445-8224-e7e8db733842 ro quiet splash vt.handoff=7
SourcePackage: unity
UpgradeStatus: Upgraded to oneiric on 2011-10-14 (17 days ago)
dmi.bios.date: 09/30/2008
dmi.bios.vendor: Award Software International, Inc.
dmi.bios.version: F12
dmi.board.name: EP45-DQ6
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.modalias: dmi:bvnAwardSoftwareInternational,Inc.:bvrF12:bd09/30/2008:svnGigabyteTechnologyCo.,Ltd.:pnEP45-DQ6:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnEP45-DQ6:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
dmi.product.name: EP45-DQ6
dmi.sys.vendor: Gigabyte Technology Co., Ltd.
version.compiz: compiz 1:0.9.6+bzr20110929-0ubuntu5
version.ia32-libs: ia32-libs 20090808ubuntu26
version.libdrm2: libdrm2 2.4.26-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 7.11-0ubuntu3
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.11-0ubuntu3
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg: xserver-xorg 1:7.6+7ubuntu7
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.6.0-1ubuntu13
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99~git20110811.g93fc084-0ubuntu1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.15.901-1ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110411+8378443-1

Revision history for this message
Marc Bowes (marcbowes) wrote :
Revision history for this message
Marc Bowes (marcbowes) wrote :

Here is the strace of compiz when the copy-progress-bar is minimized.

Revision history for this message
Marc Bowes (marcbowes) wrote :

Here is the strace of compiz while the copy-progress-bar is maximized.

Revision history for this message
Marc Bowes (marcbowes) wrote :

To be clear, I can reproduce this with any progress bar. The easiest is a file copy:

1) Start file copy of a reasonable (10's to 100's) of files which will last a few minutes
2) Peek at `top`, notice compiz is using 15%+ CPU and system has become extremely laggy
3) Minimize progress bar, notice compiz has dropped to 4% CPU and system is responsive

This is the first performance issue I've yet encountered with my setup. The progress bars really aren't that dazzling to warrant the performance hit I'm seeing.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu):
status: New → Confirmed
Revision history for this message
mpk (marcin-kowalski) wrote :

This bg also manifests when downloading a largish (2000 messages) mailbox via Thunderbird. The progress bar in this case, at the bottom of Thunderbird results in pinning of 2 cores, 1 by Thunderbird and 1 by Compiz.

When Thunderbird was minimized the CPU load dropped off.

Doing a 'strace' revealed exactly the same behaviour as outlined by marcbowes.

Revision history for this message
Matt B (matty-brennan) wrote :

I noticed this when using gparted. top reported Compiz using ~55% of a CPU. When I dragged the progress bar off-screen, compiz was reduced to 16%. I dragged the progress bar on and off the screen a few times and confirmed that the jump in compiz was directly related.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The issue with Unity hooking all screen updates and making them much slower and more CPU-intensive was bug 988079. So please test that fix in Ubuntu 12.10 (or a fully updated 12.04). I recommend 12.10 because you will get better performance and more of the latest fixes, than 12.04 has.

Changed in compiz (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Marc Bowes (marcbowes) wrote :

Thanks for the update Daniel.

I cannot confirm the fix in 12.04/10 because I stopped using Unity because of this bug. I guess if nobody else confirms/denies you can just close it. If I switch back to Unity and still have issues I'll open another issue.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for compiz (Ubuntu) because there has been no activity for 60 days.]

Changed in compiz (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.