Windows vs. Linux kernel performance

An anonymous Microsoft developer spilled some juicy opinions about why Windows kernel performance isn’t all it could be and answered some longstanding questions about Windows vs. Linux kernel performance in the process. Although he has recanted much of what he said, some of his insights make a ton of sense.

Read more

Slipstream drivers into Windows XP

Slipstream drivers into Windows XP

For about a month after a new version of Windows is released, it supports just about any hardware you’re likely to throw at it. And after that, it’s not quite that easy. And once the version is end of life, it’s harder still. So here’s an easy way to slipstream drivers into Windows XP. For your retro PC that you use offline, of course. Don’t go online with this system.

I stumbled across Driverpacks back in March, and I’ve finally had a chance to spend some serious time working with them. What they mean is that if you’re willing to do some work, you can make a disc that will install Windows with functional drivers for virtually any computer in existence.

Read more

Contingency. Or how I escaped from Windows 0.7

I thought I traced my Windows 0.7 printing problem to the presence of a USB bluetooth adapter, but it turned out that was wrong. My wife called about mid-day to say the machine wasn’t printing anymore.

Fortunately, I’d never gotten around to downgrading my netbook from Windows XP to Windows 0.7. It saved the day.

Read more

Slimming down Windows XP for SSDs and nettops

I found a very long and comprehensive guide for using Nlite to reduce the size of a Windows installation.

The guide is geared towards an Asus Eee. But it should work well on pretty much anything that has an Intel CPU in it.A couple of tweaks to his settings will make it suitable for AMD-based systems. Just remove anything Intel-specific, and add back in anything specific to AMD, and there you go.

And if you have a multi-core or hyperthreaded CPU, leave multi-processor support in.

I also recommend slipstreaming SP3 and all the hotfixes you can. Then you don’t have to run Windows Update, them, and you don’t have to clean up after it either. I haven’t investigated all of the whys and wherefores, but I’ve noticed that the more you slipstream ahead of time, the smaller your Windows directory ends up being. I have some systems at work that are constantly bursting at the seams on their system partitions. Other systems, which were built later from a copy of Windows with more stuff slipstreamed in, have a lot more breathing room.

Using the i64x.com instructions, you can pretty much count on getting a Windows XP installation under half a gig in size. That makes life with a small SSD much more bearable, since a typical installation tends to take a couple of gigs these days.

I’ll add some tips of my own. Inside the Windows directory, there are some subdirectories named inf, repair, and servicepackfiles. Compress those. That’ll free up some more space–at least a couple dozen megabytes in most cases.

If you’re really cramped, compress the whole Windows directory. Boot time actually decreased by a couple of seconds when I did this (down to 12 seconds from about 14), but software installations slowed considerably. But for everyday operation, you could almost consider NTFS compression a performance trick. It makes sense; an SSD can sometimes saturate the bus it’s connected to, so data compression lets it shove 20-50% more data through that saturated bus.

The downside is that when you install something that lives in the Windows directory, it has to not only copy the data into place, but also compress it. Installing the .NET Framework on a system with a compressed Windows directory takes a while.

A good compromise is to install pretty much everything you think you’ll need on the system, then start compressing.

It’s difficult to make a case for compressing the entire drive, however. Most modern data file formats are compressed–including all modern media formats and Office 2007 documents–so turning on NTFS compression on directories storing that kind of data gives no benefit, while introducing overhead.

Second impressions: Intel D945GCLF2, aka the dual-core Atom desktop board

I finally got Windows XP installed on what’s going to be my mother in law’s dual-core Intel Atom computer. I’ve spent some more time with it, and it’s a good board, as long as you’re willing to live with its limitations.First of all, if your Windows CD doesn’t include SP3 (or possibly SP2), slipstream it. SP1 or earlier won’t boot on this board. I used nlite to slipstream SP3 and all the updates. A good way to download all the updates easily is to use CTupdate. Since installing updates can take nearly as long as installing the OS itself, it’s nice to have a CD that’s completely up to date. And while you’re at it, you can remove some useless Windows components like Windows Messenger and MSN Explorer.

Intel's dual-core Atom boardSince I don’t play 3D games and my mother in law doesn’t either, I have no idea what the gaming performance of this machine is, but I doubt it’s very good. That’s fine; it’s not what this board is designed for.

For productivity apps, it’s a perfectly reasonable PC. I can switch back and forth between my 2 GHz P4 and this Atom and not feel like I’m missing anything.

Due to the D945CLF2‘s size, it has some limitations. It only has two SATA and one PATA connectors. Hooking up her PATA hard drive and CD-RW got interesting. I managed to do it, but it isn’t pretty. If I’d known this was going to turn into a system rebuild, I would have bought a SATA hard drive instead of the PATA drive I got. If you’re thinking of one of these boards to upgrade an old PC, keep that in mind, especially if the 3.5″ bays aren’t very close to the 5.25″ bays.

There’s only one PCI slot. That’s less of a problem than it sounds like, as it has onboard video, audio, gigabit Ethernet, and lots of USB ports. But if you want to add a TV tuner or Firewire ports, you can only choose one or the other.

There’s also only one memory slot, and it can only take 2 GB. So there’s no dual-channel memory, although the chipset and BIOS support it. The CPU is AMD64 compatible, but the main reason people go 64-bit is to be able to run 4 GB of memory or more. It would have been nice if Intel could have crammed one more memory slot in there somehow.

Nvidia is talking about releasing a chipset for the Atom that will give better performance than Intel’s. Intel pairs the Atom with a very old chipset, and Nvidia says they can make it perform better. Intel doesn’t want the Atom to compete with the Celeron, so they’re not making performance a top priority. Even still, it’s not bad. I would imagine Nvidia could make it an even nicer setup.

But at any rate, this is a nice board. It’s reliable, cheap, and fast enough. If I decide to modernize any of my computers in the next year, I would consider one of these. They run cool and quiet and consume very little power. Lately I’ve been a big proponent of buying off-lease 2 GHz P4s, but I think an Atom rig is also worth considering. It’ll cost a little more, but its power usage is so low, it’s likely to more than make up the difference over the course of its lifetime.

First impressions: Intel D945GCLF2, aka the dual-core Atom desktop board

I was never able to get my mother in law’s computer to misbehave, but my son was. He’d crawl up to it, press whatever buttons he could find, and invariably it would reboot and give beep codes.

Intel's dual-core Atom boardSo I decided the best bet would be to drop in a new system board. I went against all my usual practices and bought an Intel. Further research showed the stock board was made by MSI. I’ve never had good luck with MSI boards, although I know they’re popular. This one lasted five years, which is five years longer than the other two MSI boards I’ve seen. I was able to find an exact replacement, but the $70 price scared me off. Especially without knowing whether it was the board or CPU that was bad. With an Award BIOS, beep codes generally mean bad memory (a memory tester vindicated that), a bad CPU, or bad motherboard. Not very specific.

I wanted something reliable, cheap, and no slower than what she had. With an unlimited budget, I’d buy an Asus board, since I have a 6-year-old Asus board in the basement that’s still humming like new. Gatermann ran an Asus P55T2P4 for 10 years before it died, and I’ve seen lots of other Asus boards reach old age. Unfortunately, I couldn’t find an Asus motherboard/CPU combo for less than $100.

So I went with Intel’s desktop dual-core Atom board by default. Intel motherboards are as unexciting as they come, and I hate monopolies, but the board has a 3-year warranty and I know from my experience supporting Micron desktop PCs with Intel boards in them that it’ll last at least that long.

I had to change the ATX backplate, but I was glad to find the Compaq front-panel connector had the same pinout as this Intel board. Removing the old backplate was the hardest part of the installation, as the board mounts with just four screws.

I entered the BIOS on powerup and was disappointed to see I couldn’t disable the onboard video. I really wanted to plug a video card into the lone PCI slot and disable the onboard video to save some memory and bandwidth. I also found enabling USB boot was clunky, but other than that, the BIOS was predictable.

The board itself runs extremely cool. The power supply fan doesn’t blow out hot air or even warm air–it’s cool.

You have to slipstream SP2 or SP3 to install Windows XP on this board. I haven’t done that yet, so I don’t know yet how well it runs XP. But being a dual-core, 1.6 GHz CPU, it should be OK. When XP was introduced, 1.6 GHz single-core CPUs were mainstream. It may not keep up with the old 2.1 GHz AMD Athlon XP the system came with, but without all the crapware Compaq loads at the factory, I’ll bet the system will be faster than it ever was even if the new CPU isn’t quite as fast as the old one.

Is Windows optimization obsolete?

I read a statement on Bob Thompson’s website about Windows optimization, where he basically told a reader not to bother trying to squeeze more speed out of his Pentium-200, to spend a few hundred bucks on a hardware upgrade instead.
That’s flawed thinking. One of the site’s more regular readers responded and mentioned my book (thanks, Clark E. Myers). I remember talking at work after upgrading a hard drive in one of the servers last week. I said I ought to put my 10,000-rpm SCSI hard drive in a Pentium-133, then go find someone. “You think your Pentium 4 is pretty hot stuff, huh? Wanna race? Let’s see who can load Word faster.” And I’d win by a large margin. For that matter, if I were a betting man I’d be willing to bet a Pentium-200 or 233 with that drive would be faster than a typical P4 for everything but encoding MP3 audio and MP4 video.

Granted, I’ve just played into Thompson’s argument that a hardware upgrade is the best way to get more performance. An 18-gig 10K drive will run at least $180 at Hyper Microsystems, and the cheapest SCSI controller that will do it justice will run you $110 (don’t plug it into anything less than an Ultra Wide SCSI controller or the controller will be the bottleneck), so that’s not exactly a cheap upgrade. It might be marginally cheaper than buying a new case, motherboard, CPU and memory. Marginally. And even if you do that, you’re still stuck with a cruddy old hard drive and video card (unless the board has integrated video).

On the other hand, just a couple weekends ago I ripped out a 5400-rpm drive from a friend’s GW2K P2-350 and replaced it with a $149 Maxtor 7200-rpm IDE drive and it felt like a new computer. So you can cheaply increase a computer’s performance as well, without the pain of a new motherboard.

But I completely and totally reject the hypothesis that there’s nothing you can do in software to speed up a computer.

I was working on a computer at church on Sunday, trying to quickly burn the sermon onto CD. We’re going to start recording the sermon at the 8:00 service so that people can buy a CD after the 10:45 service if they want a copy of it. Since quality CDs can be had for a buck in quantity, we’ll probably sell discs for $2, considering the inevitable wear and tear on the drives. Today was the pilot day. The gain was set too high on the audio at 8:00, so I gave it another go at 10:45.

That computer was a Pentium 4, but that Pentium 4 made my Celeron-400 look like a pretty hot machine. I’m serious. And my Celeron-400 has a three-year-old 5400-rpm hard drive in it, and a six-year-old Diamond video card of some sort, maybe with the S3 ViRGE chipset? Whatever it is, it was one of the very first cards to advertise 3D acceleration, but the card originally sold for $149. In 1996, for 149 bucks you weren’t getting much 3D acceleration. As for its 2D performance, well, it was better than the Trident card it replaced.

There’s nothing in that Celeron-400 worth bragging about. Well, maybe the 256 megs of RAM. Except all the l337 h4xx0r5 bought 1.5 gigs of memory back in the summer when they were giving away 512-meg sticks in cereal boxes because they were cheaper than mini-frisbees and baseball cards (then they wondered why Windows wouldn’t load anymore), so 256 megs makes me look pretty lame these days. Forget I mentioned it.

So. My cruddy three-year-old Celeron-400, which was the cheapest computer on the market when I bought it, was outperforming this brand-new HP Pentium 4. Hmm.

Thompson says if there were any settings you could tweak to make Windows run faster, they’d be defaults.

Bull puckey.

Microsoft doesn’t give a rip about performance. Microsoft cares about selling operating systems. It’s in Microsoft’s best interest to sell slow operating systems. People go buy the latest and worst greatest, find it runs like a 1986 Yugo on their year-old PC, so then they go buy a Pentium 4 and Microsoft sells the operating system twice. Nice, isn’t it? After doing something like that once, people just buy a new computer when Microsoft releases a new operating system. Or, more likely, they buy a new computer every second time Microsoft releases a new operating system.

Microsoft counts on this. Intel counts on this. PC makers count on this. Best Bait-n-Switch counts on this. You should have seen those guys salivating over the Windows 95 launch. (It was pretty gross, really, and I didn’t just think that because I was running OS/2 at the time and wasn’t interested in downgrading.)

I’ve never had the privilege of working for an employer who had any money. Everywhere I’ve worked, we’ve bought equipment, then run it until it breaks, then re-treaded it and run it until it breaks again. Some of the people I work with have 486s on their desks. Not many (fortunately), but there are some. I’ve had to learn how to squeeze the last drop of performance out of some computers that never really had anything to offer in the first place. And I haven’t learned much in the past since I started my professional career in Feb. 1997, but I have learned one thing.

There’s a lot you can do to increase performance without changing any hardware. Even on an old Pentium.

First things first. Clean up that root directory. You’ve probably got dozens of backup copies of autoexec.bat and config.sys there. Get them gone. If you (or someone else) saved a bunch of stuff in the root directory, move it into C:My Documents where it belongs. Then defrag the drive, so the computer gets rid of the phantom directory entries. You’ll think you’ve got a new computer. I know, it’s stupid. Microsoft doesn’t know how to write a decent filesystem, and that’s why that trick works. Cleaning up a crowded root directory has a bigger effect on system performance than anything else you can do. Including changing your motherboard.

2. Uninstall any ancient programs you’re not running. Defrag afterward.

3. Right-click your desktop. See that Active Desktop crap? Turn it off. You’ll think you’ve got a new computer.

4. I am not making this up. (This trick isn’t in the book. Bonus.) Double-click My Computer. Go to Tools, Folder Options. Go to Web View. Select “Use Windows Classic Folders.” This makes a huge difference.

5. Turn off the custom mouse pointers you’re using. They’re slowing you down. Terribly.

6. Download and run Ad Aware. Spyware DLLs kill your system stability and speed. If you’ve got some spyware (you never know until you run it), Ad Aware could speed you up considerably. I’ve seen it make no difference. And I’ve seen it make all the difference in the world. It won’t cost you anything to find out.

7. Remove Internet Explorer. It’s a security risk. It slows down your computer something fierce. It’s not even the best browser on the market. You’re much better off without it. Download IEradicator from 98lite.net. It’ll remove IE from Win95, 98, ME, NT, and 2K SP1 or lower. If you run Windows 2000, reinstall, then run IEradicator, then install SP2 (or SP3 if it’s out by the time you read this). Then install Mozilla, or the lightweight, Mozilla-based K-Meleon instead. Need a lightweight mail client to replace Outlook Express? Give these a look. Run Defrag after you remove IE. You won’t believe how much faster your computer runs. Trust me. An Infoworld article several years back found that removing IE sped up the OS by as much as 15 percent. That’s more than you gain by moving your CPU up one speed grade, folks.

8. Reinstall your OS. OSs accumulate a lot of gunk, and sometimes the best thing to do is to back up your My Documents folder, format your hard drive, and reinstall your OS and the current versions of the apps you use. Then do all this other stuff. Sure, it takes a while. But you’ll have to do it anyway if you upgrade your motherboard.

9. Get a utilities suite. Norton Speed Disk does a much better job of defragmenting your hard drive than Windows’ built-in tool. It’s worth the price of Norton Utilities. Good thing too, because 90% of the stuff Norton Utilities installs is crap. Speed Disk, properly run, increases your disk performance enough to make your head spin. (The tricks are in the book. Sorry, I can’t give away everything.)

10. Get my book. Hey, I had to plug it somewhere, didn’t I? There are 3,000 unsold copies sitting in a warehouse in Tennessee. (O’Reilly’s going to get mad at me for saying that, so I’ll say it again.) Since there are 3,000 unsold copies sitting in a warehouse in Tennessee, that means there are about 3,000 people who don’t need to buy a new computer and may not know it. I don’t like that. Will there be an updated version? If those 3,000 copies sell and I can go to a publisher and tell them there’s a market for this kind of book based on the 2002 sales figures for my last one, maybe. Yes, there are things that book doesn’t tell you. I just told you those things. There are plenty of things that book tells you that this doesn’t. It’s 260 pages long for a reason.

Recent Microsoft OSs are high on marketing and low on substance. If Microsoft can use your computing resources to promote Internet Explorer, MSN, or anything else, they’ll do it. Yes, Optimizing Windows is dated. Spyware wasn’t known to exist when I wrote it, for instance. Will it help? Absolutely. I stated in that book that no computer made in 1996 or later is truly obsolete. I stand by that statement, even though I wrote it nearly three years ago. Unless gaming is your thang, you can make any older PC run better, and probably make it adequate for the apps you want to run. Maybe even for the OS you want to run. And even if you have a brand-new PC, there’s a lot you can do.

Like I said, I’d rather use my crusty old Celeron-400 than that brand-new P4. It’s a pile of junk, but it’s the better computer. And that’s entirely because I was willing to spend an hour or two cleaning it up.

Desktop Linux and the truth about forking

Desktop Linux! I wanna talk a little more about how Linux runs on a Micron Transport LT. I chose Debian 2.2r3, the “Potato” release, because Debian installs almost no extras. I like that. What you need to know to run Linux on a Micron LT: the 3Com miniPCI NIC uses the 3C59x kernel module. The video chipset uses the ATI Mach64 X server (in XFree86 3.36; if you upgrade to 4.1 you’ll use plain old ATI). Older Debian releases gave this laptop trouble, but 2.2r3 runs fine.
I immediately updated parts of it to Debian Unstable, because I wanted to run Galeon and Nautilus and Evolution. I haven’t played with any GNOME apps in a long time. A couple of years ago when I did it, I wasn’t impressed. KDE was much more polished. I didn’t see any point in GNOME; I wished they’d just pour their efforts into making KDE better. I still wish that, and today KDE is still more polished as a whole, but GNOME has lots of cool apps. Nautilus has the most polish of any non-Mac app I’ve ever seen, and if other Linux apps rip off some of its code, Microsoft’s going to have problems. It’s not gaudy and overboard like Mac OS X is; it’s just plain elegant.

Galeon is the best Web browser I’ve ever seen. Use its tabs feature (go to File, New Tab) and see for yourself. It’s small and fast like Opera, compatible like Netscape, and has features I haven’t seen anywhere else. It also puts features like freezing GIF animation and disabling Java/JavaScript out where they belong: In a menu, easily accessible. And you can turn them off permanently, not just at that moment.

Evolution is a lot like Outlook. Its icons look a little nicer–not as nice as Nautilus, but nice–and its equivalent of Outlook Today displays news headlines and weather. Nice touch. And you can tell it what cities interest you and what publications’ headlines you want. As a mail reader, it’s very much like Outlook. I can’t tell you much about its PIM features, because I don’t use those heavily in Outlook either.

The first time I showed it to an Outlook user at work, her reaction was, “And when are we switching to that?”

If you need a newsreader, Pan does virtually everything Forte Agent or Microplanet Gravity will do, plus a few tricks they won’t. It’s slick, small, and free too.

In short, if I wanted to build–as those hip young whippersnappers say–a pimp-ass Internet computer, this would be it. Those apps, plus the Pan newsreader, give you better functionality than you’ll get for free on Windows or a Mac. For that matter, you could buy $400 worth of software on another platform and not get as much functionality.

Linux development explained. There seems to be some confusion over Linux, and the kernel forking, and all this other stuff. Here’s the real dope.

First off, the kernel has always had forks. Linus Torvalds has his branch, which at certain points in history is the official one. When Torvalds has a branch, Alan Cox almost always has his own branch. Even when Cox’s branch isn’t the official one, many Linux distributions derive their kernels from Cox’s branch. (They generally don’t use the official one either.) Now, Cox and Torvalds had a widely publicized spat over the virtual memory subsystem recently. For a while, the official branch and the -ac branch had different VMs. Words were exchanged, and misinterpreted. Both agreed the original 2.4 VM was broken. Cox tried to fix it. Torvalds replaced it with something else. Cox called Torvalds’ approach the unofficial kernel 2.5. But Torvalds won out in the end–the new VM worked well.

Now you can expect to see some other sub-branches. Noted kernel hackers like Andrea Archangeli occasionally do a release. Now that Marcelo Tosatti is maintaining the official 2.4 tree, you might even see a -ac release again occasionally. More likely, Cox and Torvalds will pour their efforts into 2.5, which should be considered alpha-quality code. Some people believe there will be no Linux 2.6; that 2.5 will eventually become Linux 3.0. It’s hard to know. But 2.5 is where the new and wonderful and experimental bits will go.

There’s more forking than just that going on though. The 2.0 and 2.2 kernels are still being maintained, largely for security reasons. But not long ago, someone even released a bugfix for an ancient 0.-something kernel. That way you can still keep your copy of Red Hat 5.2 secure and not risk breaking any low-level kernel module device drivers you might be loading (to support proprietary, closed hardware, for example). Kernels are generally upward compatible, but you don’t want to risk anything on a production server, and the kernel maintainers recognize and respect that.

As far as the end user is concerned, the kernel doesn’t do much. What 2.4 gave end users was better firewalling code and more filesystems and hopefully slightly better performance. As far as compatibility goes, the difference between an official kernel and an -ac kernel and an -aa kernel is minor. There’s more difference between Windows NT 4.0 SP2 and SP3 than there is between anyone’s Linux 2.4 kernel, and, for that matter, between 2.4 and any (as of Nov. 2001) 2.5 kernel. No one worries about Windows fragmenting, and when something Microsoft does breaks a some application, no one notices.

So recent events are much ado about nothing. The kernel will fragment, refragment, and reunite, just as it has always done, and eventually the best code will win. Maybe at some point a permanent fracture will happen, as happened in the BSD world. That won’t be an armageddon, even though Jesse Berst wants you to think it will be (he doesn’t have anything else to write about, after all, and he can’t be bothered with researching something non-Microsoft). OpenBSD and NetBSD are specialized distributions, and they know it. OpenBSD tries to be the most secure OS on the planet, period. Everything else is secondary. NetBSD tries to be the most portable OS on the planet, and everything else is secondary. If for some reason you need a Unix to run on an old router that’s no longer useful as a router and you’d like to turn it into a more general-purpose computer, NetBSD will probably run on it.

Linux will fragment if and when there is a need for a specialized fragment. And we’ll all be the better for it. Until someone comes up with a compelling reason to do so, history will just continue to repeat itself.