« Visual Studio 2010 Wish List | Main | DevTeach Comes to Toronto »

Improving Personal Computer Systems Performance

Improving Personal Computer System Performance

So, you’ve reached the conclusion that your laptop or desktop personal computer is not running as fast as the day you bought it. There are a number of folks out there that are trying to capitalize on this rather common complaint. I’m sure you’ll find lots of sites that offer software downloads (usually free) that can “radically improve system performance” or make equally unbelievable claims. Folks looking for ways to save money on gas are often tempted with equally outrageous claims made by those selling gadgets that fit over your carburetor or magic fluids to dump into your gas tank. Most of us recognize these products as bogus because we understand car engines or that you can’t increase your car’s stability by putting a bowling ball in the trunk.

To better understand how to make your computer as fast as it can be, it’s important to know how a computer works and what makes it run more slowly.

Understanding the Central Processing Unit (CPU)

Every computer has a central processing unit or “CPU” for short. A CPU’s job is to run the programs—all the programs including the operating system software (like Windows), the device drivers (that control the hardware devices like video displays, hard drives and keyboards), and a host of other programs like word processors, games, utilities and the Internet Browser. Without programs the CPU is simply a chip of silicon. Programs make your computer do what it’s told to do. The CPU runs these programs as fast as it can and always does what the programs tell it to do—even if it means over-heating the processor or damaging other components.

The CPU’s ability to run programs efficiently is limited to a great extent by the number of operations the CPU can process in a given length of time. This is generally measured by the number of “cores” the processor contains (all have at least one, some have four or more) and the speed at which each core runs. This speed is usually indicated by the “speed” or clock rate of the CPU. Think of a CPU like the engine in your lawnmower or car. A small engine might be able to run at 1000 revolutions per minute while a powerful racing engine might be able to rev up to 10,000 RPM. In the early days of personal computers, the CPU was run at fairly low speeds because they would overheat if run too fast—just like a car engine. The first computers often ran at 2.5 million cycles per second or less. That might seem pretty fast when compared to a piston engine (and it is), but today a processor can be run at 3.3 billion cycles per second—or more. We simplify this speed as “3 GHz”.

CPU speed gives you an indication of how fast the CPU can process program instructions. For example, a Pentium CPU running at 1 billion cycles per second (1 GHz) is half as efficient as the same CPU running at 2 billion cycles per second (2 GHz).

More cores mean that the CPU can process more than one operation at a time—like a juggler with more arms. Faster processors cost more money as they are more expensive to build—they can cost twice as much as a slower CPU. It’s unusual for a typical home computer to have the fastest processor available so in some cases it might make sense to simply upgrade the CPU to a faster speed to get better performance—especially if you want to sink another couple of hundred dollars into the system. This is not possible in most laptops but not that difficult to do in desktop computers. But before you rush off to buy a faster CPU, let’s examine things that can slow down your computer’s processor.

Managing Heat

When a CPU executes code, it heats up—this is perfectly normal. However, when the CPU gets too hot it’s designed to slow down—like a Ford Pinto climbing a hill pulling a house trailer. Each CPU has a heat spreader (like the fins on the back of a stegosaurus) which is cooled by one or more fans that remove the heat out of the system. Unfortunately, too many people put their computers out of sight under a desk so the heat never escapes—it’s simply recirculated back into the computer cabinet. Laptops exhaust their heat out the side of the unit and use the bottom surface to carry away the heat. These don’t work nearly as well as desktops and often overheat to the point that they damage the internal parts like the graphics processing unit (GPU). In either case, it’s important to let the heat get carried away into the relatively cool air in the room.

The GPU is just another CPU that’s an independent processor dedicated to handling the complex task of displaying information and pictures on the system screen. It can generate as much or more heat than the CPU so it often has its own cooling heat spreader and fan.

Make sure the computer fans can exhaust the hot air and get cool air into the cabinet. If your room (or car) is already 85 degrees Fahrenheit, your system is going to overheat a lot more easily than if the room is 65 degrees—uncomfortably cool (for people) but this makes computers very happy.

Reduce Swapping

Just because one CPU is faster than another does not make it process programs faster than another because there are lots of things that can slow down or stop the CPU—regardless of how fast it’s capable of running. Consider the guy down the street who owns a Porsche sports car that can top 200 mph when the cops aren’t watching. Given our traffic, there are no places where he can safely or legally get over 45 mph. Like sports cars in traffic, all CPUs regardless of their rated speed, wait at the same speed.

Every computer system has several kinds of “memory”.

o   Read-only memory (ROM): This is where the basic input-output system (BIOS) is stored. It contains the program use to start Windows. The BIOS is loaded into the ROM at the factory.

o   Random-access memory: This is the place where all programs and information your computer processes is stored. It is totally cleared when your computer is turned off so it must be reloaded each time you start your computer or run a program. Today, systems have from 256,000 (256 K) characters (or bytes) to 3,000,000,000 (3 GB) of RAM (or more).

o   Hard Disk: This is not really “memory” but it’s where Windows and other programs can be stored—on a permanent basis. Hard disk drives are mechanical devices and are very slow when compared to RAM or ROM. Your programs can write to the hard disk to save information (pictures, documents or newly installed programs) and read back from the drive once the data is stored. The hard disk is preloaded at the factory with Windows and usually sample programs or games.

o   CD/DVD Disk: This is also called “optical” media. It uses plastic disks that are recorded using laser technology. Some drives can write to the media but not all of them do. Programs are often sold on CD or DVD media so they can be installed and saved to your hard disk.

o   Floppy Disk: Most systems no longer have “floppy” media which works very much like a hard drive to record data on a removable disk.

o   USB memory stick: This form of memory simply encloses one or more memory chips into a carrier that can plug into the computer’s Universal Serial Buss (USB) port. These devices are typically very fast—faster than hard drives but with limited capacity.

Consider that the CPU must load its programs from RAM or ROM—it cannot directly access any other media. To make sure that the CPU has programs to run, Windows pulls programs into RAM from the hard drive or other memory sources. While the programs or data files are being loaded, Windows must wait—just like that kid loading groceries into those paper (or plastic) bags at the supermarket. The bag-boy can only load groceries as fast as the conveyer belt brings them to him. A computer system works in much the same way. It can take quite some time to get a program loaded from the hard disk or CD drive. Fortunately, Windows knows how to multi-task—it can usually perform several operations at the same time—if it’s not too busy. This means while the CPU waits for a disk read or write to complete, Windows will give it other tasks to perform. The CPU also has to wait for other hardware devices as well. These include the video device (which displays everything on the computer screen), the USB ports and most especially on the mouse and keyboard—driven by the slowest (and most impatient) device of all—you.

To reduce the number and duration of these disk delays, Windows keeps as many programs and data files as it can in RAM hoping that you’ll need the same pieces again. And that’s usually the case. Consider that Windows itself is brought into RAM in pieces and most of these pieces (called DLLs) are used over and over again without having to go back to the hard drive. The more RAM your system has, the more time the system can save by not having to re-fetch programs (or information like pictures, movies or documents) over and over again. Some operating systems need more RAM than others. XP needs at least 512 million bytes (the same as .5GB) of memory to run adequately. Vista needs at least twice that much, but a lot more if you want to have room in memory for other programs.

I recommend at least 2 GB of RAM for Vista.

And that’s the key. To have enough room for both the Windows programs and features you’re using and the other programs you want to run, you’ll need RAM—and lots of it. Lack of RAM can dramatically slow down a computer. Why? Well, when you ask Windows to run a program like a word processor or a game, it must be loaded into RAM. If there is room, the CPU has to wait while it’s loaded but not after that—at least not for the hard drive (almost the slowest thing in your system next to the keyboard). If there is not enough space in RAM, Windows starts to look for blocks of RAM to be overlaid with the new program or data file. It starts with those pieces that are least-frequently-used and copies the data (documents, pictures or anything you’ve created or added) to hard disk to make room. This takes time, often a lot of time. This process is called “swapping”. To accommodate swapping, the OS creates a “virtual memory” space on the hard drive—automatically expanding it to accommodate more and more data. If the OS warns you that it’s out of virtual memory space it means it needs more RAM or less work to do.

So Windows was able to wedge your program or data file into memory and begin working on it. Unfortunately, a moment later Windows might be asked to switch focus to the program whose data has been swapped out of memory. Since Windows can’t continue until the pieces are reloaded into RAM, Windows has to stop work on the program and wait while it’s reloaded and all of the pieces are reassembled. This process can trigger more swapping as the system desperately tries to keep enough programs and data in memory to do your bidding. The result? Well, some users try to make Windows respond by clicking on the mouse. This does not help—it gives Windows even more to do. Other users simply turn off the system. Ah, this is bad. When the system comes back up it must repair any damage that was done by the sudden shut-down. Sometimes it’s best to go take a caffeine break and let the system settle down. At that point you can save your work and stop one or more programs so Windows has half a chance to work correctly.

To improve performance you can do a number of things to counteract this problem. First, add as much RAM as the system can hold—up to about 3.5 GB in XP. No, not all systems can accept that much memory—especially not older ones. Some are limited to less than .4 GB so check your computer’s specifications before going out to buy RAM. You can also go to any of the memory vendor’s sites (like Crucial.com) and run their memory finder. This program is designed to tell you how much RAM your system has and can accept.

One of the advantages of the 64-bit Windows versions is that they can support a lot more memory and not have to swap as much—if at all.

Vista adds another feature to make the process of swapping even faster—it can use a USB memory stick for part of the swap file. Consider that writing and reading to a USB key is not as fast as writing to system RAM, but far faster than writing to the hard drive. This is called a “ReadyBoost” drive. All you need to do is insert a sufficiently fast USB key—some are specially designed for this purpose.

Optimizing Hard Disk Performance

Next, you can make sure that the hard drive is as fast as possible it plays a big role in how fast your system starts, loads programs and swaps when there is not enough RAM. SATA drives move data on and off their platters far faster than PATA/IDE drives. Drives that spin faster and with bigger on-board cache memory are faster than those without these features. Today, many drives can rotate at 7500 RPM—far faster than the standard 5400 RPM.

Again, before you rush out and get a faster hard drive, do what you can to optimize the existing drive. There are utilities built into Windows that can make your drive more efficient including the Disk Defragmenter. This utility is designed to reorganize the programs and data files on your hard drive so they can be retrieved more quickly and to free up contiguous spaces on the drive so that files can be written more quickly. Drives should be defragmented every week or so. Windows Live One Care includes an automatic disk defragmenter—if it’s enabled. This is not necessary for Vista as defragmenting is done automatically—unless you disable it.

Warning: Hard drives, like any mechanical device will eventually fail. Mine last from 1 to 5 years or so—depending on the drive quality and how much they are used. Be prepared for a disk “crash” or other failure by performing full system backups along with more frequent “critical file” backups to removable media like CDs, USB keys or external drives. Ideally, you should take these backups off site—get them out of the house or business so if something happens, you still have a backup.

Optimizing Video Performance

If you’re running games or graphics management programs, these draw heavily on the graphics processing unit (the GPU) built into the video card or interface built into the motherboard. A graphics program must draw lines, various shapes and perform all kinds of complex operations that require very complex computations to perform. If the GPU can’t perform these tasks (and many can’t), the CPU must—or the game won’t run. A good video interface can take on quite a bit of this work with a custom GPU (and its own RAM) to perform many or all of these complex operations. A cheaper card does proportionally fewer of these operations so a game or other graphics-dependent program like Windows Media Player makes the CPU work pretty hard—sometimes so hard that it can’t keep up with the job—or it overheats. This means your movie or game runs and halts and tries to catch up. So, if you’re planning on playing movies or (harder yet), play games, invest in a better video card. Consider that when you buy a laptop, only the best ones let you upgrade the video interface—the GPU. This means that you’re stuck with the performance of a laptop GPU but not with a desktop that can have its GPU (video card) replaced.

Eliminating Spurious Programs

For reasons of greed and evil intent it seems that almost everywhere you visit on the Internet is riddled with programs that add overhead to your system’s load. These might be Yahoo or Google addins that improve your browser functionality but consume more of your CPU’s time to load and maintain in memory. These are generally benign compared to the byproducts of the far more evil web pages that download and install nasty programs on your system. These programs can be “adware” that monitors your activity and pops up those irritating ads, “spyware” that reports your browser and other activity including personal information to a remote computer, “viruses” that can attack your computer in a variety of ways or programs that turn your system into a SPAM broadcaster—a “Spambot”.

You’ll find many companies out there that provide “free” solutions to these all-too-common infestations. Unfortunately, some of these programs tell you that you’re infected when you’re not. However, they’re right—they are the infection. They throw up popup messages that tell you that you need your “registry cleaned” or you need to buy their anti infection program. It’s a maniacal conundrum—like a person with TB going door-to-door warning of TB. Other companies offer free virus scanners that latch on to the private areas of your OS and report that you’re heavily infected with several hundred nasty viruses—even on a clean system. They warn of evil “cookies” which in of themselves are harmless. Cookies are simply files saved to your hard disk to make the web sites you use faster and more user-friendly.

Are all free virus scanners evil? No, I don’t think so. I do know that there are very few companies that can afford to stay in business without some way to suck revenue out of their customers—but I’m kinda cynical.

I recommend consulting a fair, honest review of these very important programs to help find the best one for your needs and budget. No, don’t trust me or anyone else—especially anyone that does not have something to lose by pointing you at the wrong answer. I found one of these reviews in the September (’07) edition of Consumer Reports—a magazine I trust. Be careful, there are several other virus scanner review sites on the web. Some look very suspicious—pointing to some pretty obscure products.

When evaluating anti-virus/anti-spyware/anti-adware scanners, consider that they also consume CPU and disk resources—sometimes lots of resources. These programs are notorious for making your computer slower—sometimes a lot slower. It does no good to run more than one of these. The better the package, the lower the impact on the system without compromising their ability to filter out the scum and pass through the pure content you want to view. These programs often run when you stop using the computer—assuming you leave it on. If you shut down the system when it’s not in use, the scanner has to run while you’re using it and trying to do other stuff. It’s a better idea to leave your system on at least a couple of times a week and schedule the scanner to run during these times of inactivity.

If the Virus Scanner Fails

It’s critically important to get rid of the leaches that sap your system’s strength and resources. A well-written scanner can disinfect your system—in most cases. If it can’t you’ll need to take more drastic steps. Another option is to use the XP System Restore program to undo the damage. This utility reverts the system back to a point in time before the attack. It also might uninstall other useful programs—that will need to be reinstalled but only after you have installed the best virus/adware/spyware scanner you can find.

The Windows Firewall is also another essential element in your arsenal of protection. It can prevent Spambots from taking over your system that’s constantly connected to the internet.

If you can’t fix or find a virus or other infestation using these conventional means, you might have to revert your system to the original state—to the way it came from the factory.

WARNING: This is not a trivial task. Do not attempt this without a full understanding of what it entails and some expert help—especially on a laptop where there are going to be lots of custom device drivers that must be provided by the manufacturer—something that’s hard to do if your system is not working.

A full system restore cannot be done without the restore CD/DVD that came with your system or a backup image. Restore CDs can usually be bought fairly cheaply from the manufacturer—or come with the system. Without these you might still be able to repair your system with a restore partition installed when the system was first built by the manufacturer. Consult your manufacturer for details.

Personally, when I buy a new computer I immediately do a system image backup that can be used just for this problem. Lenovo laptops can provide a program called “Rescue and Recovery” that’s ideal for this kind of backup—as well as weekly backups.

Improve Network Performance

Many of you complain about slow browser performance. Consider that the browser—whether it’s Internet Explorer (IE), Firefox or Mozilla they all wait at the same speed. They wait for attention from the CPU which might be busy working on other programs. They also must wait for the content to be delivered from the web site. Some think that buying a faster broadband connection will solve all of their problems. Well, it will certainly help move content from a web site to your system but only up to a point. Most sites gate the speed at which they return content so they can support more customers at once. This means that a 3 MB (3,000,000 bytes/second) connection won’t retrieve data any faster than a 1 MB connection if the site is only delivering content at .5 MB.

Consider that not all broadband connections are equal. While some advertize 3, 4 or 20 GB speeds, these numbers do not always reflect the actual speed you’ll see when using the connection. This is especially true for cable modem broadband connections. In this case, while the rated speed is generally higher than other types of broadband, your connection often has to share the cable with everyone on your block. That’s why it seems slower at some times during the day.

A phone-line “Digital Subscriber Link” (DSL) broadband connection is different. While often rated at lower speeds, it is not a shared circuit but a dedicated link (via a copper wire) connected to the telephone central office or DSL concentrator a few miles away.

If you want to know how fast your broadband connection is running, visit one of the speed test sites like http://www.speedtest.net/. These will give you an easy-to-understand graphical display of your download and upload speed—the rate that data can be sent to you and the rate at which you can send back responses or upload files. If these values are not within 70% of the speed you’re paying for, talk to your broadband provider.

Stop WiFi Leaks

If you’re using a Wireless Internet (WiFi) connection to access the internet, all of your network traffic (all of the information being sent to and from the Internet) is being broadcast by your system on a radio signal. This signal can be picked up miles away by some not-so-sophisticated hardware. It’s critically important that you make doubly sure that these radio signals are protected from access by others that would steal your personal information or simply leach off your broadband connection. If someone does get connected to your WiFi router or access point, you must share the broadband bandwidth with this leach. Incidentally, it’s illegal to log on to someone else’s WiFi connection—it’s like stealing cable services.

The first step is to ensure that your WiFi router or remote access point is programmed to perform “WEP encryption”. This process makes sure that every packet of information sent over the radio signal is scrambled so only those with the right password can unscramble and use it. This also means you need to protect this WEP “key”—the password to unlock the information. It’s usually a lot easier for some nefarious dude to get someone in your family to give away the key than to try to crack the encryption.

The next step is to make sure that WiFi router uses MAC filtering. Each network card and each wireless radio has a unique MAC number (address)—no two cards anywhere in the world have the same number. You can program your router to accept connections from only those systems that have their MAC address in a list of valid addresses. This locks out the kid up the street that talked your kid out of the WEP key. The MAC address can be found by starting a Windows Command prompt and entering “IPCONFIG /ALL”.

One of my friends, Dan Appleman wrote a great book on this subject. See http://www.alwaysuseprotection.com/ for more details and tips on how to protect your home network.

In Summary

In an overall sense, consider that your system can only do so much with the CPU power, RAM and disk IO throughput. If you ask it to do more or if the Windows asks it to do more than it can handle, it will get progressively slower. There are a number of things you can do to make your computer faster without spending money. As often as not, it’s what you don’t do that makes it faster—it’s when you don’t run too many programs at once, when you don’t have lots of pictures or web pages open at once so the system has more RAM and CPU time to do your bidding.

I hope this helps.


Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)