You are not logged in.

#1 2006-07-22 01:16:14

user
Member
Registered: 2006-03-29
Posts: 465

Why userspace sucks

http://trends.newsforge.com/article.pl? … 1&from=rss

Why userspace sucks

Dave Jones, maintainer of the Fedora kernel, gave his "Why Userspace Sucks - (Or, 101 Really Dumb Things Your App Shouldn't Do)" talk in the afternoon for a standing-room only crowd. Jones' talk focused on his efforts at reducing the boot time in Fedora Core 5 (FC5), and the shocking discoveries he made along the way.

He started his work by patching the kernel to print a record of all file accesses to a log to look for waste. He found that, on boot, FC5 was touching 79,000 files and opening 26,000 of them. On shutdown, 23,000 files were touched, of which 7,000 were opened.

The Hardware Abstraction Layer (HAL) tracks hardware being added and removed from the system, to allow desktop apps to locate and use hardware. Jones says that HAL takes the approach "if it's a file, I'll open it." HAL opened and reread some XML files as many as 54 times, he found. CUPS, the printer daemon, performed 2,500 stat() calls and opened 500 files on startup, as it checked for every printer known to man.

X.org also goes overboard, according to Jones. Jones showed that X.org scans through the PCI devices in order of all potential addresses, followed by seemingly random addresses for additional PCI devices, before starting over and giving up. He paid special attention to X fonts, noting that he found that X was opening a large number of TrueType fonts on his test system.

To see what it was up to, he installed 6,000 TrueType fonts. Gnome-session, he found, touched just shy of 2,500 of them, and opened 2,434 fonts. Metacity opened 238, and the task bar manager opened 349. Even the sound mixer opened 860 fonts. The X font server, he found, was rebuilding its cache by loading every font on the system. He described the font problems as bizarre.

The next aspect of his problem identification was timers. The kernel sucks too, he said: USB fires a timer every 256 milliseconds, for example. The keyboard and mouse ports are also polled regularly, to allow support for hot-pluggable PS/2 keyboards and mice. And the little flashing cursor in the console? Yes, its timer doesn't stop when X is running, so the little console cursor will continue to flash, wasting a few more CPU cycles.

Jones says that you don't need the patched kernel and tools that he used to do the tests. Using strace, ltrace, and Valgrind is plenty to do the work to get rid of waste, says Jones.

An audience member asked, after fixing all these little issues, how much time is saved? Jones replied that roughly half the time wasted by unnecessary file access was saved. However, the time saved is taken up by new features and applications that also consume system resources. As a result, says Jones, it is necessary to do this kind of extensive testing regularly.

Another attendee asked, how can we avoid these problems on an on-going basis? One suggestion is to have users who don't program, but wish to be involved in improving Linux, take on the testing work. The last question of the question-and-peanut gallery answer session at the end of the talk asked if KDE was as bad as GNOME in these tests. Jones replied that he had not tried.

As the Q&A continued, the session became more of a Birds of a Feather (BoF) than a presentation. The back-and-forth between Jones and the audience had most of the packed room in stitches most of the way through.


I removed my sig, cause i select the flag, the flag often the target of enemy.

SAR brain-tumor
[img]http://img91.imageshack.us/img91/460/cellphonethumb0ff.jpg[/img]

Offline

#2 2006-07-22 04:50:07

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: Why userspace sucks

Yea.  The sad part is that the reason Windows is so slow compared to Linux is that it does this kind of bullshit even more.

I think another problem is that many developers are so focused on getting new features in, that they forget to make sure their code is optimized and doing the right thing.

Last but not least, complaining is worth nothing if you don't start the fix.  (I said start, not suggest)

Offline

#3 2006-07-24 14:48:26

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Why userspace sucks

Copy/pasting a newsforge article here with no text of your own is fruitless, and wastes arch resources.  Please try linking directly to the article, and at least saying something about it - this is not digg

Offline

#4 2006-07-24 15:57:45

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Why userspace sucks

It made the webserver touch at least 34000 new files and itself!


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#5 2006-07-24 16:11:35

user
Member
Registered: 2006-03-29
Posts: 465

Re: Why userspace sucks

phrakture wrote:

Copy/pasting a newsforge article here with no text of your own is fruitless, and wastes arch resources.  Please try linking directly to the article, and at least saying something about it - this is not digg

Alright next time i will say it, btw, didn't you see what i  said? ;-)


I removed my sig, cause i select the flag, the flag often the target of enemy.

SAR brain-tumor
[img]http://img91.imageshack.us/img91/460/cellphonethumb0ff.jpg[/img]

Offline

#6 2006-07-25 02:40:34

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: Why userspace sucks

i digg it.


I am a gated community.

Offline

#7 2006-07-26 12:03:51

shaurz
Member
Registered: 2004-02-02
Posts: 358

Re: Why userspace sucks

I found a similar sort of thing when I was digging through the shitpile that is init/rc scripts when I had the crazy idea to replace the whole lot with a single program written in Python. It's no wonder Linux is so slow! Problem is, file-happy developers can get away with it when computers get faster, so software is perpetually slow...

Offline

Board footer

Powered by FluxBB