Thursday, 17 January 2008

UPDATE: Firefox/Mozilla performance under linux/Xorg

The addition of the Option "XAANoOffscreenPixmaps" "true" also helps with the Intel hardware I have. Be sure not to use EXA on the Intel because it also makes things really slow for now. Maybe EXA will be fixed some day on the "intel" driver, but currently it's better not to use it.

Here is the profile from the EXA intel current git (Firefox 2), it's slow:



Additional links:

business-exa-intel.sysprof.bz2

Firefox/Mozilla performance under linux/Xorg

Today I've had enough of some sites being slow under Linux and Firefox. The particular site at this occasion was business.hr. The machine in question is a 3.4 GHz Pentium 4 with a Radeon X300, running the open source "ati" driver (this one loads the actual "radeon" driver). The Linux on the machine is a Debian unstable running xorg core ver. 1.4.1~git20080105-1 and ati ver. 6.7.197-1. I've tried running current git Xorg and drivers, but while I was happy to have it compile, it segfaulted (log file attached bellow).

The site was just awfully, painfully, slide show like slow when scrolling the page. Latest nightly build of Firefox 3 didn't help. My colleague had a ubuntu 7.10 laptop with intel graphics board that worked like a charm on that page. Fortunately we had another laptop with ubuntu 7.04 with intel that exhibited the same problem as my X300 machine. So I decided upgrading it to 7.10 to see if it will go away. I did that and enabled bling (compiz). The problem went away on the newly upgraded laptop.

I figured that enabling compiz on the desktop machine could help. So I've found instructions. Compiz didn't work (gtk-window-decorator didn't draw any window decorations). But the business.hr site scrolling got fast! It turns out that the Option "XAANoOffscreenPixmaps" "true" was the key. I made profiles using sysprof.

The slow one (Firefox 2):


The slow one (Firefox 3):


The fast one:



We spent 81% of the CPU time in X server in the slow case and 40% of the time in the fast case.

I wanted to test another scenario with graphics so I found this site . Even with the naughty XAAOffScreen pixmaps off, it was jerky under Firefox 2, and worked much more smoothly under Windows Firefox 2. So I was delighted to find that Firefox 3 made it smooth under Linux too. Hooray for Linux! Wanting to see if the Firefox 3 was faster still under Windows, I was amused to find that Firefox 3 was jerky there now. Still, under the best case scenario for both systems (ffox 2 on win32, and ffox3 on linux), Windows seemed better CPU usage wise (35% vs 60% CPU usage).


There is clearly more room for optimizations, but it seems quite nice now with Firefox 3 and the XAA stuff fixed. In addition to this quirk, with intel driver on the current Xorg git working nice only when EXA is disabled with Option "AccelMethod" "XAA", Linux distribution vendors certainly must be careful with how they will tune their Xorg configs and patch their drivers.


UPDATE:

Option "AccelMethod" "EXA" also seems to work for the X300, without having to do a Option "XAANoOffscreenPixmaps" "true", which makes sense because XAA and EXA are different acceleration paths. But I'm not sure about the accross the board performance and stability of EXA on the X300. I'll make a new post when I make the tests.

Here's a snippet of the profile with EXA:



UPDATE 2

The addition of the Option "XAANoOffscreenPixmaps" "true" also helps with the intel hardware I have. Be sure not to use EXA on the intel because it also makes things really slow for now. Maybe EXA will be fixed some day, but currently it's better not to use it on intel.

Here are additional links and files.

sysprof:
business-xaaNOoffscreenpixmaps.sysprof.bz2 (fast)
business-xaaoffscreenpixmaps.sysprof.bz2 (slow)
business-ffox3.sysprof.bz2 (slow)

cube-firefox2.0.bz2 (slow)
cube-firefox3.0.bz2 (fast)

business-exaX300.sysprof.bz2 (fast)


Crashing Xorg GIT:
xlog.log

Bug report on the freedesktop bugzilla:
https://bugs.freedesktop.org/show_bug.cgi?id=12069