Opacity css seems to kill performance in Firefox 2 under Linux
December 5, 2006 1:42 PMSo I was working on the charting plugins new search request view popup where, when we popup the chart, we try to be all sexy and fade the background to a slightly transparent black that makes the popup look very modal. The good news is that it looks very swank, the bad news is that on my machine every time I click it my CPU usage jumps to about 50% and my machine become unresponsive. I know sometimes there is a stability/performance trade off for good looks, just ask Jens with his whining mac book, but this was ridiculous.
It turns out that only on Firefox 2 under linux is this a problem. The problem lies with the css attributes -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80);. These are the bits that produces the magic slightly transparent background. It seems that somewhere in the transition from Firefox 1.5 to 2 the rendering of this, under linux, has gone terribly wrong. It might be the case that some magic rpm or deb is just lurking around the corner to fix this up but it was broken for me on Fedora Core 5 and for Nick using Ubutu (and the stock debs).
For the time being we have put a hack in place that will check to see if the user is using Firefox 2 on Linux and if so the background will be the grayish color, but not transparent. This fixes things up.
Once again, twice within a week, I am reminded that if you get a support case that seems impossible and you just can't reproduce it, it really pays to try to replicate the environment of the user as close as you can, browser versions and everything.



Copyright © 2009 Atlassian Pty Ltd.

4 Comment(s)
This happens when you haven't got 3D acceleration enabled in Linux. Even on very fast hardware (Intel Conroe) it's slow. The problem is it's not always easy to enable direct rendering with every configuration and in most distros it's disabled by default.
By klevo at December 7, 2006 12:02 AM
Opacity (and many other things) are a LOT slower in FF/Linux (or OSX, afaik) than in FF/Windows.
And I have all the 3D and DRI stuff enabled and working fine, and a really fast machine. The Windows Firefox feels faster even when running in a remote desktop, on a slower machine, inside VMware, over wireless LAN.
FF/Linux is just slow, period, I hate this (I only use Linux) but there's nothing we can do. Except maybe kill GTK! :-(
By Mihai Bazon at February 10, 2007 8:34 AM
this code is what i search. thank you for great Opacity code.
By Emexci at July 9, 2007 11:11 AM
I doubt that this has anything to do with hardware video acceleration. Firefox doesn't use OpenGL or the likes in its rendering engine. Besides that, I have a video card that can play the latest 3D games smoothly, and still Firefox gives me troubles. I'm using the latest Firefox 3.0.5 on Kubuntu, and it still performs much, much worse than the same browser on the same machine in Windows XP. For example, my friend's blog on http://blogger.gtvone.com/wp/ is horrible to scroll through.
By Sybren at December 24, 2008 3:44 AM