Public bug reported: When profiling compiz/unity (during pulse animations) I noticed LauncherIcon::ColorForIcon was almost the single most expensive function (after malloc and free) in the compiz process. This didn't look right so I added some debug messages and found that it was SimpleLauncherIcon::GetTextureForSize repeatedly reloading (and reprocessing) some icons from scratch on every single redraw.
The cause is pretty obvious in SimpleLauncherIcon::GetTextureForSize. It assumes the loaded icon size is always exactly that of the desired icon size for the launcher. Obviously for most fixed sized icons this won't be true. So it reloads and reprocesses those icons on EVERY frame when redrawing the launcher. Fixing the simple logic error in SimpleLauncherIcon::GetTextureForSize I found I could reduce compiz/unity CPU usage during animations (when the launcher is constantly redrawing) by up to 50%. And even a constant 25% improvement on my regular idle desktop. So definitely worth fixing. ProblemType: Bug DistroRelease: Ubuntu 11.04 Package: unity 3.8.16-0ubuntu1~natty1 ProcVersionSignature: Ubuntu 2.6.38-10.46-generic 2.6.38.7 Uname: Linux 2.6.38-10-generic x86_64 NonfreeKernelModules: fglrx Architecture: amd64 CompizPlugins: [core,bailer,detection,composite,opengl,compiztoolbox,decor,vpswitch,place,imgpng,regex,unitymtgrabhandles,grid,session,snap,mousepoll,resize,move,animation,expo,ezoom,workarounds,resizeinfo,wall,staticswitcher,fade,scale,unityshell] Date: Sun Aug 7 12:59:41 2011 InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1) ProcEnviron: LANGUAGE=en_AU:en LANG=en_AU.UTF-8 SHELL=/bin/bash SourcePackage: unity UpgradeStatus: No upgrade log present (probably fresh install) ** Affects: unity Importance: Undecided Status: Fix Released ** Affects: unity (Ubuntu) Importance: Undecided Status: Fix Released ** Tags: amd64 apport-bug natty running-unity -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/822157 Title: Unity is wasting CPU repeatedly reloading some icons on every redraw in SimpleLauncherIcon::GetTextureForSize To manage notifications about this bug go to: https://bugs.launchpad.net/unity/+bug/822157/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs