Tuesday, January 5, 2010

Digg this

The Myth About GHz

Electronic Chip
Typically when people I talk to discuss how 'fast' a computer is, they reference clock speed.  A common question is "how many GHz does your computer have?"  But clock speed is only one piece of what determines how 'fast' a computer is.

I am typing this post on a computer that has a 2.53GHz processor.  In the next room I have a computer with a 3.2GHz processor.  Guess which one is faster?  I'll give you a hint, it's not the computer with the 3.2GHz processor.

So, if clock speed does not translate into realized performance, then what does?  In order to determine the answer to this question, it's necessary to think about the components of a computer that are slow.  It's the weakest link that determines the strength of the chain.  This is also true in computers.  The slowest components and the frequency at which they are used determine the overall performance.

Processors are very fast when compared to system memory or hard disks.  Therefore, if memory access or disk access frequency is reduced then a computer will perform faster.  Processor cache reduces system memory access frequency.  A bargain processor like an Intel Celeron processor might have 512K cache on the processor.  Whereas a higher end processor like those found in the iMac might have up to 8MB cache on the processor.  That's 16 times more cache!  Now you know why the bargain PC with the 2.5GHz processor isn't such a bargain after all.

To give you an idea of how much of a difference additional cache on the processor makes, when a data is fetched from cache it takes around one clock cycle.  When data is fetched from system memory it can take over 100 clock cycles.  A computer that has very little cache on the processor will pay that additional cost in clock cycles many more times during normal use than a computer that has a lot of cache on the processor.

When a computer's processor needs data, it first attempts to fetch from cache.  If the data is not in cache, then it attempts to fetch the data from system memory.  If the data isn't in cache or system memory then it attempts to fetch the data from the hard disk.  Disk access can be over 100 times slower than memory access.  So, if memory access can cost over 100 clock cycles then disk access can cost over 10,000 clock cycles.  And whereas you can't do much about the cache on the processor once you own a computer (except maybe buy a new processor), you can almost always add more system memory (see Why Do You Care About 64-bit? for information on memory limitations).  Upgrading system memory or random access memory (RAM) can have a dramatic impact on the speed of a computer.

High performance mechanical hard disks and solid state disks (SSDs) can also go a long way toward improving the speed of any computer.  No hard disk is a substitute for processor cache or system memory.  Even the fastest SSDs don't have access time comparable to that of system memory.  However, if a computer is doing a lot of reading from disk (like when it boots up or when it loads a large program) then a SSD can really have a noticeable impact on overall performance.

Bus speeds aside (usually computers that support higher-end processors have faster bus speeds), the final performance consideration should be the number of processor cores.  More cores means that more things can be run at one time by the computer.  It should be noted that additional cores do not scale linearly (two cores do not mean twice the performance of a single core).  Nonetheless, multicore processors are here to stay.  In the future computers and software will grow with the number of processing cores.

In summary, clock speed (or GHz) means very little without some cache on the processor to back it up.  Additional system memory can be a great way to improve performance if RAM is lacking.  And if you have the cash then a SSD can have a major impact on disk access times, especially with disk reads.  Finally, two cores are better one, but not twice as good.

No comments:

Post a Comment