Registry optimization

I gave my Windows 2000 system a little tuneup today. Nothing major, but it feels peppier now, and didn’t take all that long to do. Nor did it require any expensive utilities.

This works with Windows 2000, XP, NT4, and Vista. For Windows 9x advice, you’ll have to turn to an old critically acclaimed book written by someone you’ve never heard of.First, I ran Ccleaner, which does a general cleanup of temporary files and obsolete/incorrect registry entries. It found more than 300 MB of garbage to get rid of. Be sure to run both the file and registry cleanup, as they’re separate buttons. It found a lot less in the registry that needed to go.

Stage 2 is to run NTregopt. I recommend downloading the all-inclusive collection from Donn Edwards, which includes NTregopt, plus the Sysinternals system file defragmenter and the excellent JK-Defrag. NTregopt packs the registry, removing the empty space formerly occupied by now-deleted entries. In my case, it reduced the size of the registry by about 200K. Not a lot, but I don’t do a lot of installing/uninstalling on this system.

Stage 3 is to run the Sysinternals Pagedefrag, which is included in the Donn Edwards bundle. In my case, most of my registry files were in nice shape, but one of them was in a startling 28 fragments. Pagedefrag took care of that.

Of course, while you’re at it, it doesn’t hurt to do a general defragmentation. JK-Defrag is fantastic–much better than most commercial programs, and it’s free. In my younger days I might do a quick defrag both before and after registry optimization, but one defrag afterward takes less time and should usually suffice.

The registry optimization took about 10 minutes total, including the reboot. The disk defragmentation took another 45 minutes, but there was no need for me to sit and watch that.

The system boots faster now. It also feels peppier, but since the registry wasn’t in horrible shape, I’m guessing the defragmentation did more to help system speed than the registry work. Getting rid of 300 megs of garbage and moving a few gigabytes of rarely used data files to the end of the disk to make room up front for the stuff you do use makes a difference.

The nice thing is that optimization like this used to require a $99 software package, like Norton Utilities or Nuts & Bolts, and both of those packages also installed some junk that really did a lot more harm than good (like Norton Crashguard, which I used to call Norton Crashmaker). I devoted an entire chapter of the aforementioned book to installing and using utilities suites while keeping the problem-causing stuff off your system.

Today, you can download and install two files that do it for free and stay out of your way except when you need them.

Shrinking Windows 2000 and XP

Seeing as this used to be my big topic, I would be remiss if I didn’t mention that it’s now possible to remove Internet Explorer, Windows Media Player, and other components from Windows 2000 and XP using software from litepc.com.
I haven’t tested it, so I don’t know how much difference it makes, performance-wise. It made a large difference in Windows 98–removing IE caused system speedups of anywhere from 10 to 25 percent, which is more than you gain by upgrading your CPU a speed grade or two. This was mostly due to two factors: reduced memory consumption and inefficiencies in the FAT/FAT32 file systems. It’s been known for about 20 years that performance starts to degrade dramatically once you have more than 100 files in a program or operating system’s subdirectory (Microsoft even said as much in the DOS 5.0 manual).

Since most people run XP and 2000 with NTFS, and since systems with half a gig of memory or more are becoming commonplace, I don’t know if removing IE will make as much difference in this day and age. It certainly makes sense from a security standpoint though–rip out IE, Media Player and Outlook Express and replace them with third-party apps, and you’ve just eliminated most of the programs whose security holes affect desktop PCs. It comes at the expense of compatibility though. Some programs utilize Outlook Express and IE components–although some programs will install the missing DLLs.

But for special-purpose PCs, or other PCs that aren’t running any software that uses those programs, or PCs that are strapped for disk space, it makes sense to give it a shot.

Tweaking Debian for all it’s worth

I fell way behind on my Sorcerer Linux box. The thing compiled code for a day trying to keep up, and finally I started questioning the point of it all. Yeah, the kernel and glibc all benefit from having fresh, up-to-date and aggressively-optimized code, but my highly-optimized KDE 2.2 was slow as a dog, and why am I bothering compiling a superfast version of more? So I installed Debian.

But I wanted ReiserFS. So I went and downloaded the special Debian boot floppies that support Reiser. I just let it do an install over the network. The end result was a copy of Debian Testing on my system. Of course I wanted to upgrade to unstable, so I edited /etc/apt/sources.list and changed the occurrences of “testing” to “unstable.”

Next, I wanted the hottest kernel on the block, which happens to be 2.4.17-mjc2. There is no Debian package for that. So I made one. For myself. I’m pretty sure the one I made won’t work on your computer. Here’s what I did, so you can make one that won’t work on my computer.

apt-get install kernel-source-2.4.17

Download the mjc patch to /usr/src

cd /usr/src

ln -s kernel-source-2.4.17 linux

bzcat 2.4.17-2.4.18-pre1-mjc2.patch.bz2 | patch -p0 (substitute the name of the mjc patch you downloaded)

make xconfig

Pick some of the cool new options like the pre-emptible kernel and realtime scheduler

make-kpkg kernel_image

dpkg -i kernel-image-2.4.18pre1-mjc2_i386.deb

echo "kernel-image-2.4.18pre1-mjc2 hold" | dpkg --set-selections

rm /usr/src/linux

I also went into /etc/fstab, found my ReiserFS partitions, and under the (options) heading, I added the notail and noatime options to increase filesystem speed.

How’s it run? I’m about to find out. But even without this stuff, running GNOME apps under IceWM, Debian is awfully fast. I like KDE, but in my experience it’s so much slower than GNOME, at least when GNOME is running in conjunction with IceWM. GNOME apps like Gnumeric and AbiWord load in under 2 seconds, even on a slow hard drive.

Optimizing BIOSes and optimizing DOS

Optimizing the BIOS. Dustin Cook sent in a link to Adrian’s Rojak Pot, at www.adriansrojakpot.com , which includes a BIOS tweaking guide. It’s an absolute must-read. I have a few minor quibbles with a couple of the things he says, particularly about shadowing and caching your ROMs with Windows 9x. He says you shouldn’t do it. He’s right. He says you shouldn’t do it because Microsoft says not to do it with Windows NT, and Windows 9x “shares the same Win32 architecture.” It does and it doesn’t, but that’s flawed logic. Shadowing ROMs isn’t always a bad thing; on some systems that eats up some usable memory and on others it doesn’t, depending on the chipset and BIOS it uses. But it’s pointless because Windows doesn’t use the BIOS for anything, unless you’re in safe mode. Caching ROMs makes very little sense; there’s only so much caching bandwidth to go around so you should spend it on caching memory that’s actually being used for something productive. So who cares about architecture, you shouldn’t cache and shadow your ROMs because Windows will ignore it one way or the other, so those facilities are better spent elsewhere. The same thing is true of Linux.

Still, in spite of this minor flaw I found in a couple of different spots, this is an invaluable guide. Perfect BIOS settings won’t make a Pentium-90 run like a Pentium III, but poor BIOS settings certainly can make a Pentium III run more like a 386DX-40. Chances are your BIOS settings aren’t that bad, but they can probably use some improvement. So if you want the best possible performance from your modern PC, visit Adrian’s. If you want to optimize your 386 or 486 or low-end Pentium, visit the site I mentioned yesterday.

Actually, it wouldn’t be a half-bad idea to take the downloadable versions of both guides, print them, and stick them in a binder for future reference. You’ll never know when you might want to take them with you.

Optimizing DOS again. An awful lot of system speed is psychological. I’d say maybe 75% of it is pure psychology. It doesn’t matter so much whether the system really is fast, just as long as it feels fast. I mentioned yesterday keyboard and screen accelerators. Keyboard accelerators are great for people like me who spend a lot of time in long text files, because you can scroll through them so much faster. A keyboard accelerator makes a big difference in how an old DOS system feels, and it can improve the responsiveness of some DOS games. (Now I got your attention I’m sure.)

Screen accelerators are a bit more of a stretch. Screen accelerators intercept the BIOS calls that write to the screen and replace them with faster, more efficient code. I’d estimate the speedup is anywhere from 10 to 50 percent, depending on how inefficient the PC’s BIOS is and whether it’s shadowing the BIOS into RAM. They don’t speed up graphics at all, just text mode, and then, only those programs that are using the BIOS–some programs already have their own high-speed text routines they use instead. Software compatibility is potentially an issue, but PC power users have been using these things since at least 1985, if not longer, so most of the compatibility issues have long since been fixed.

They only take a couple of kilobytes of memory, and they provide enough of a boost for programs that use the BIOS that they’re more than worth it. With keyboard and screen accelerators loaded in autoexec.bat, that old DEC 386SX/20 feels an awful lot faster. If I had a copy of a DOS version of Microsoft Word, I could use it for writing and it wouldn’t cramp my style much.