Eyes Above The Waves

Robert O'Callahan. Christian. Repatriate Kiwi. Hacker.

Thursday 24 May 2007

Performance Observation

I'm running Tp2 page load tests on a Linux box --- a real dual-core machine, not a VM. Interesting observations:


  • Firefox uses 40% of one processor
  • X11 uses 60% of one processor
  • One processor is basically idle

I don't know why we're spending so much time in the X server. These are old pages and they're fairly simple. Maybe we're not using cairo well, or cairo isn't using X well.

I also wonder why we aren't using two processors more effectively here. Firefox should be able to overlap with X. They must be waiting on each other for some reason.

I'm tempted to go off on a rant here about how X has sucked for so long and continues to suck in spite of all promises to the contrary. But I won't.



Comments

Jeff
Please go on a rant about X. It seems that people used to dislike it (http://www.art.net/~hopkins/Don/unix-haters/x-windows/disaster.html)
Maybe I'm not looking hard enough but most users seem to like X these days. I'm not sufficiently well informed to have a strong opinion, but I'd like to hear yours.
Boris
That's basically what I see nowadays, yeah. I think there might be some of both, basically; there's definitely cairo not using X well around.
Robert O'Callahan
The fundamental problem with X is that putting performance critical functionality, like drawing, in a separate process from the application imposes a performance penalty and complicates everything, all for the sake of the uncommon case of cross-network display --- which is better handled by a VNC-style approach, anyway.
David
The original reason for the separate X11 server process was to reduce the amount of memory consumed by the low-level graphics libraries which in the pre-shared library days would have to be statically linked into every process. Of course, those days are long over.
Tessa
Depending on your Linux distro, it might be some new bug in X. I've been trying to figure out why in the latest Ubuntu distro (Feisty), desktop performance degrades over time. Some links:
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/104481
http://ubuntuforums.org/showthread.php?t=443799
Dan Amelang
Hi Rob,
I think it would be more productive if you posted this information (and more, like an oprofile report) to the cairo and/or xorg lists. Frankly, I don't see anything constructive that can come out of ranting about performance to an audience that is unlikely to help you resolve your problem. Let's resume this conversation on the lists (I'm active on both lists).
About your assertion of what the "fundamental problem" is regarding X, I have a different view.
As one that has read many, many system-wide performance profiles of applications that use the X server in various environments (e.g. desktop, embedded devices), I can say that the fact that drawing is done in a separate process is rarely the cause of poor performance.
I'd be happy to go on, but as I said, this isn't the most productive place to carry on discussions of this nature.
Thank you for all the wonderful work you're doing at Mozilla. I'm a very big fan of yours.
Robert O'Callahan
You're absolutely right, it's not productive, that's why I wrote a short note instead of a long screed.